datatable.Frame.ncols

Number of columns in the frame.

Parameters

return
int

The number of columns can be either zero or a positive integer.

Notes

The expression len(DT) also returns the number of columns in the frame DT. Such usage, however, is not recommended.

See also

  • .nrows: getter for the number of rows of the frame.