question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

this has always been an internal attribute. We can simply replace by ._is_copy and provide a deprecation warning on the property.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
has2k1commented, Dec 31, 2017

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. A copy() 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 hit is_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.

1reaction
jorisvandenbosschecommented, Dec 22, 2017

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.

@amueller not sure there is anything to add to: http://pandas.pydata.org/pandas-docs/stable/indexing.html#returning-a-view-versus-a-copy

Explicitly taking a copy is not mentioned in those docs, so could certainly be added.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found