Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get dataframe deminsions

# importing pandas module
import pandas as pd
  
# making data frame
data = pd.read_csv("https://media.geeksforgeeks.org/wp-content/uploads/nba.csv")
  
# dataframe.size
size = data.size
  
# dataframe.shape
shape = data.shape
  
# dataframe.ndim
df_ndim = data.ndim
  
# series.ndim
series_ndim = data["Salary"].ndim
  
# printing size and shape
print("Size = {}
Shape ={}
Shape[0] x Shape[1] = {}".
format(size, shape, shape[0]*shape[1]))
  
# printing ndim
print("ndim of dataframe = {}
ndim of series ={}".
format(df_ndim, series_ndim))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #dataframe #deminsions
ADD COMMENT
Topic
Name
7+4 =