Posted on 10th September 2024|15 views
What is a shape in python?
Posted on 10th September 2024| views
The shape means a tuple which provides you with a sign of the various dimensions are there in the array. Assume you have loaded some data in some variable train and you want to check the dimensions of that file then you can do something like this
train.shape (5,6)
train.shape[0]# this will display the number of rows
2
train.shape[1]# this will display the number of columns
3