import pandas as pd
numbers = {1,2,3,4,5}
ser = pd.Series(numbers)
print ser
I write this code in python for pandas series. but it's giving this
"AttributeError: 'module' object has no attribute 'Series'"
please help me
The Error in my problem is the file name.
I save the file as pandas.py that's why i got the error.
http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.html
data : array-like, dict, or scalar value Contains data stored in Series
Don't think a set counts as array-like, so just convert it to a list before calling pd.Series.
import pandas as pd
numbers = {1,2,3,4,5}
ser = pd.Series(list(numbers))
Output:
print ser
0 1
1 2
2 3
3 4
4 5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With