Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python dataframe shape

print(df.shape)
# (891, 12)

print(df.shape[0])
# 891

print(df.shape[1])
# 12
Comment

shape pandas

df.shape
Comment

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)
Comment

pandas shape

>>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
>>> df.shape
(2, 2)
Comment

df shape

df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
>>> df.shape
(2, 2)
Comment

Display shape of the DataFrame

# Display shape of the DataFrame
df.shape
Comment

dataframe.shape return what?

>>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4],
...                    'col3': [5, 6]})
>>> df.shape
(2, 3)
Comment

df shape

df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4],
...                    'col3': [5, 6]})
>>> df.shape
(2, 3)
Comment

Shape of a dataframe

# 2. Shape of a dataframe
df.shape
Comment

PREVIOUS NEXT
Code Example
Python :: how to count null values in pandas and return as percentage 
Python :: get ip address py 
Python :: midpoint 
Python :: seconds to datetime.time 
Python :: create a dictionary from a list python 
Python :: reset_index(drop=true) 
Python :: round off to two decimal places python 
Python :: calculate mean median mode in python 
Python :: image crop in python 
Python :: python dictionary dynamic key 
Python :: add column in spark dataframe 
Python :: python file hashlib 
Python :: where is python installed on ubuntu 
Python :: Python Changing Directory 
Python :: how to pass parameters in python script 
Python :: python sort the values in a dictionary 
Python :: pyqt5 qtreewidgetitem enable drop drag 
Python :: how to show a frequency distribution based on date in python 
Python :: square root in python 
Python :: pythone csv 
Python :: how to convert adjacency list to adjacency matrix 
Python :: Mittelwert python 
Python :: xargs to copy file from text files to another directory 
Python :: how to read panda column 
Python :: joins in pandas 
Python :: Matplotlib rotated xticklabels 
Python :: break all loops 
Python :: convert timedelta to days 
Python :: do not show figure matplotlib 
Python :: how to merge two pandas dataframes on a column 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =