Post

PythonPython

T
Tim Parker

Posted on 27th April 2024|15 views

0
votes

Shape Python

What is a shape in python?

Answers
P
persis crystal

Posted on 27th April 2024

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

train.shape[1]# this will display the number of columns  

 3

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos