Skip to content
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

Fix DataFrame.size to consider its number of columns. #1715

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

ueshin
Copy link
Collaborator

@ueshin ueshin commented Aug 18, 2020

DataFrame.size should consider its number of columns:

>>> ks.Series({'a': 1, 'b': 2, 'c': None}).size
3
>>> ks.DataFrame({'col1': [1, 2, None], 'col2': [3, 4, None]}).size
3
>>> ks.DataFrame(index=[1, 2, None]).size
3

This should be:

>>> pd.Series({'a': 1, 'b': 2, 'c': None}).size
3
>>> pd.DataFrame({'col1': [1, 2, None], 'col2': [3, 4, None]}).size
6
>>> pd.DataFrame(index=[1, 2, None]).size
0

@ueshin ueshin requested a review from HyukjinKwon August 18, 2020 20:25
@ueshin ueshin changed the title Fix DataFrame.size. Fix DataFrame.size to consider its number of columns. Aug 18, 2020
@HyukjinKwon HyukjinKwon merged commit 31f1720 into databricks:master Aug 19, 2020
@ueshin ueshin deleted the size branch August 19, 2020 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants