Issue
I am using Spyder from anaconda
I am trying to use
import pandas.Series.str.split
but I get this error
ModuleNotFoundError: No module named 'pandas.Series'
I tried
conda upgrade pandas
did not work
I tried
pip install pandas.Series
did not work
I tried
pip install --upgrade --user pandas
did not work
Any idea how to get this working?
Solution
From the documentation
import pandas as pd
d = {'a': 1, 'b': 2, 'c': 3}
ser = pd.Series(data=d, index=['a', 'b', 'c'])
You can do
from pandas import Series
d = {'a': 1, 'b': 2, 'c': 3}
ser = Series(data=d, index=['a', 'b', 'c'])
But I would stick with import pandas as pd
which is the de-facto universal standard for this library.
Answered By - alec_djinn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.