I have a pandas dataframe (source format is CSV) and one of the columns is a 'method' class when I think it should be a 'pandas.core.series.Series'
The "troublesomeColumn" is a text column, and other text columns are naturally imported as 'pandas.core.series.Series' ... I'm not sure what is going on to cause the issue, I can't find any abnormalities in the values in the column.
I want it to be a 'pandas.core.series.Series' so that I can select by values in that column using df2 = df[df.troublesomeColumn == 'mytext']
How can I convert the "troublesomeColumn" to 'pandas.core.series.Series'? Or, if there is a way to select by value on a 'method' class, that would be fine too. I spent about 20 minutes Googling this and came up empty, I'm not sure why this is so hard.
Using Windows 10, Python 3.7.6, Conda 4.6.14.
print(type(df.troublesomeColumn))
print(type(df.goodColumn))
<class 'method'>
<class 'pandas.core.series.Series'>
If the troublesomeColumn name is the same as one of pandas.DataFrame methods, you would be accessing that pandas.DataFrame method instead of your column.
Either make sure your column names are not amongst pandas.DataFrame method names or use another method to access your columns (as suggested by @ScootCork in the comments).