I use the following code to filter out some rows in my data frame:
my_df_1 = my_df[my_df.col1.startswith('good_')]
But I got the following errors:
AttributeErrorTraceback (most recent call last)
<ipython-input-3-dbd2d6731148> in <module>()
----> 1 my_df_1 = my_df[my_df.col1.startswith('good_')]
/usr/local/lib/python2.7/dist-packages/pandas/core/generic.pyc in __getattr__(self, name)
2742 if name in self._info_axis:
2743 return self[name]
-> 2744 return object.__getattribute__(self, name)
2745
2746 def __setattr__(self, name, value):
AttributeError: 'Series' object has no attribute 'starts with'
Does anyone know what I missed? Thanks!