Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • thanks! It indeed work. however, it is still giving me a warning message: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveats in the documentation: pandas.pydata.org/pandas-docs/stable/… self.obj[item] = s Commented Jul 1, 2020 at 14:29
  • 1
    @bluetail you df is subbed of others df , when we do subset , we should add copy df=wholeddf[condition].copy() Commented Jul 1, 2020 at 14:32