Answers for "pandas frame shape"

4

df.shape 0

count_row = df.shape[0]  # gives number of row count
count_col = df.shape[1]  # gives number of col count
Posted by: Guest on May-25-2020
1

pandas shape

>>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
>>> df.shape
(2, 2)
Posted by: Guest on June-14-2020
0

python pandas shape

# The shape attribute returns a tuple (TODO appendix) where the first value is
#the number of rows and the second number is the number of columns
print(df.shape)
(1704, 6)
Posted by: Guest on January-07-2022

Python Answers by Framework

Browse Popular Code Answers by Language