Informatics Practices

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

Python Pandas

3 Likes

Answer

import pandas as pd
s = pd.Series([1, 2, 3, 4], index=['a', 'b', 'c', 'd'])
print(s)
s.info()

Output

a    1
b    2
c    3
d    4
dtype: int64
<class 'pandas.core.series.Series'>
Index: 4 entries, a to d
Series name: None
Non-Null Count  Dtype
--------------  -----
4 non-null      int64
dtypes: int64(1)
memory usage: 64.0+ bytes

Answered By

1 Like


Related Questions