-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Copy / view semanticsEnhancementNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action
Description
With the deprecation, there is no cheap way tell pandas that the user knows that they are modifying a copied dataframe. Libraries that use pandas cannot afford to always copy()
after sub-setting. My comment in the PR thread gives a specific example.
If resurrecting is_copy
is not an option, then a better solution could be a method that can be applied inline.
df = pd.DataFrame({'A':[1,2,3]})
df2 = df[df.A>2].as_copy() # New method, as_copy
df2['B'] = 2
Metadata
Metadata
Assignees
Labels
Copy / view semanticsEnhancementNeeds DiscussionRequires discussion from core team before further actionRequires discussion from core team before further action