Skip to content

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