I suspect you have the wrong import.
If you add this to your code
from pandas import Series from numpy.random import randn labels = ['a','b','c','d','e'] s = Series(randn(5),index=labels) print(s) a 0.895322 b 0.949709 c -0.502680 d -0.511937 e -1.550810 dtype: float64
It is working fine.
However, as pointed out by @jezrael, it is better to practice importing modules rather than polluting the namespace.
Instead, your code should look like this.
decision
import pandas as pd import numpy as np labels = ['a','b','c','d','e'] s = pd.Series(np.random.randn(5),index=labels) print(s)
source share