Google News
logo
Pandas - Interview Questions
What is Pandas Series?
Pandas Series is a one-dimensional labeled array capable of holding data of any type (integer, string, float, python objects, etc.)
 
Axis labels are collectively called index. Pandas Series is nothing but a column in an excel sheet.
 
Creating a series from Array

import pandas as pd
import numpy as np
# pandas as an array
data = np.array(['p','a','n','d','a', 's'])
myseries = pd.Series(data)
print(myseries)​

Output :
0 p
1 a
2 n
3 d
4 s
5 s
dtype : object
Advertisement