Properties of Series in Pandas

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

Program 1

# Properities of Series
# index,name,size values,empty,ndim, memory_usage()
# nbytes ,shape ,array ,dtype
import pandas as pd
mylist=[10,20,33,40,53,60,79,80,93,100]
mysr=pd.Series(mylist,dtype=int)

print(type(mysr))

myar=mysr.array

print(type(myar))









#print("Total Memory : ",mysr.nbytes)

# print(mysr.ndim)
# print(mysr.shape)

# print(mysr.empty)













# myar=mysr.values
# count=0
# for x in myar:
#     if(x%2==0):
#       count=count+1

# print(count)
# print("Size=",mysr.size)

#mysr=pd.Series(mylist,index=['a','b','c','d','e','f'])
# mysr=pd.Series(mylist,index=[100,101,102,103,104,105])
# print(mysr)
#mysr=pd.Series(mylist,name="This is my Series",dtype=int)
#print(mysr)
#print(mysr.name)

 

Your 15 seconds will encourage us to work even harder
Please share your happy experience 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 *