Search
 
SCRIPT & CODE EXAMPLE
 

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

PREVIOUS NEXT
Code Example
Python :: python discord bot create role 
Python :: pairplot markersize 
Python :: make seaborn plot larger to fit legend 
Python :: pd.to_excel header char vertical 
Python :: pyton 
Python :: colorutils python 
Python :: Count the data points based on columns 
Python :: restrict memory use python code 
Python :: python is not defined 
Python :: looping emails using a database with python code 
Python :: find factors of a number using while loop 
Python :: Simple Python Permutation Without Passing any argument 
Python :: save mdoel summary python 
Python :: python create named timer 
Python :: using format str with variable 
Python :: python set vs tuple performance 
Python :: Use xarray to open a ncdf file 
Python :: difference between iglob() and glob() functions in python 
Python :: Find meta tag of a website in python 
Python :: Python NumPy moveaxis function Example 
Python :: pypi autopep8 
Python :: Python NumPy asarray_chkfinite Function Example List to an array 
Python :: making dividers in tkinter 
Python :: python how to loop through array 
Python :: python model feature importance 
Python :: python string josin 
Python :: make a dict from td scrape 
Python :: mock connection sqlalchemy 
Python :: python replace date time column 
Python :: lda from scratch implementation on iris python 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =