Write code to print all the information about a Series object.

Опубликовано: 11 Октябрь 2024
на канале: Portal Express
129
1

Q. Write code to print all the information about a Series object.

Website Link :-
https://www.pathwalla.com/2020/11/wri...

Answer =

import pandas as pd
s = pd.Series([40,35,25,20,22,26,28,29,23,28])

print("shape of Series :", s.shape)
print("dtype of Series :", s.dtype)
print("index of Series :", s.index)
print("nbytes of Series :", s.nbytes)
print("Ndimension of Series :", s.ndim)
print("size of Series :", s.size)
print("NaN values of Series :", s.hasnans)

Output :-

shape of Series : (10,)
dtype of Series : int64
index of Series : RangeIndex(start=0, stop=10, step=1)
nbytes of Series : 80
Ndimension of Series : 1
size of Series : 10
NaN values of Series : False