Properties of Dataframe in Pandas

Get Job-Ready: Data Analysis using Python with 70+ Projects Start Now!!

Program 1

# Property of DataFrame
# index , columns ,size, ndim,shape,value, memory_usage(),empty
import pandas as pd
data=[(1,'vivek',8000),(2,'vikas',38000),(3,'rahul',78000),(4,'rajesh',55000)]
df=pd.DataFrame(data)

print(df)
print(df.empty)
print(df.memory_usage())
# print("SIZE: ",df.size)
# print("SHAPE: ",df.shape)
# print("Dimension: ",df.ndim)
# ar=df.values
# print(type(ar))







#mylist=[10,20,30,40,50,60,70,80,90,100]
#df=pd.DataFrame(mylist)





# df=pd.DataFrame(data,index=['A','B','C','D'],columns=['M','N','R'])
# print(df)

 

Did we exceed your expectations?
If Yes, share your valuable feedback on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *