DEPR: is_copy
See original GitHub issuethis has always been an internal attribute. We can simply replace by ._is_copy
and provide a deprecation warning on the property.
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (13 by maintainers)
Top Results From Across the Web
NIMH » Depression - National Institute of Mental Health
Depression (also called major depressive disorder or clinical depression) is a common but serious mood disorder. It causes severe symptoms that affect how ......
Read more >Depression (major depressive disorder) - Symptoms and causes
Depression is a mood disorder that causes a persistent feeling of sadness and loss of interest and can interfere with your daily ...
Read more >What Is Depression? - Psychiatry.org
Depression (major depressive disorder) is a common and serious medical illness that negatively affects how you feel, the way you think and how...
Read more >SAMHSA's National Helpline
SAMHSA's National Helpline is a free, confidential, 24/7, 365-day-a-year treatment referral and information service (in English and Spanish) ...
Read more >Depression - World Health Organization (WHO)
Depression can lead to suicide. There is effective treatment for mild, moderate, and severe depression. Overview. Depression is a common illness ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Although
is_copy
was meant to be used internally, it leaked out because it was a solution to a justifiable problem i.e you slice a dataframe, you know you created independent dataframe and you want no complaints. Acopy()
operation on the new dataframe is wasteful, especially in library code.plotnine uses
is_copy
in about 20 locations, and almost every call from the user will hitis_copy
at least 10 times, and the number goes up linearly depending on different factors. The example on the documentation page goes through about 80 of them.To repeat myself from the issue: I think @amueller use case is valid one that we should try to support. If not through
is_copy
, then in another way. (btw, @jreback it would be nice to at least answer to my objection on the issue here before merging)In case of sklearn’s
train_test_split
, they are using integer positional indexing, which will (as far as I understand fancy indexing in numpy) never return a view, not even in case of DataFrames with single dtypes. So they can be sure that their subset of a frame is a copy (which they want) and a SettingWithCopyWarning should never be raised on the frames returned by that function.Explicitly taking a copy is not mentioned in those docs, so could certainly be added.