Skip to content

astype checks notnull Fixes: #8732 #8924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

vikram
Copy link

@vikram vikram commented Nov 29, 2014

As suggested in issue #8732 if there are no nulls, we skip the nan_safe bit.

@@ -2141,6 +2141,15 @@ def setUp(self):
self.simple = DataFrame(arr, columns=['one', 'two', 'three'],
index=['a', 'b', 'c'])

def test_hasnulls(self):
df = tm.makeMissingDataframe()
self.assertEqual(df['A'].notnull().all(), False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the issue number as a comment here

@jreback
Copy link
Contributor

jreback commented Nov 29, 2014

needs a vbench for perf comparisons

@jorisvandenbossche
Copy link
Member

@jreback there are a lot of checks for different dtypes (datetime, timedelta, etc) in the _astype_nansafe (https://github.com/pydata/pandas/blob/master/pandas/core/common.py#L2541). I suppose they can't just be skipped at all if there are no nans?

@jreback
Copy link
Contributor

jreback commented Nov 29, 2014

I think the original purpose was to render object types safe (as in an actual python object)
so for example datetime should be ok

but needs some investigation

@vikram vikram closed this Nov 29, 2014
@vikram
Copy link
Author

vikram commented Nov 29, 2014

You are right needs a bit more work.

@jreback jreback added Strings String extension data type and string data Performance Memory or execution speed performance labels Nov 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Memory or execution speed performance Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants