S Ringne S Ringne - 1 year ago 164
Python Question

Convert type(String) to pandas.core.series.Series

I have a string


i want to convert it into pandas.core.series.Series.

i came across in pandas documentation that there is a code


which converts pandas series to string, but i want the opposit of it.
is there any function/code to do it?

Answer Source

This is a 2.7 implementation for casting a string to a series -

>>> abc = 'some string'
>>> import pandas as pd
>>> abc_series = pd.Series(abc)
>>> print type(abc_series)


<class 'pandas.core.series.Series'>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download