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

Support __iter__() for DataFrame and explicitly disable for Series and Index. #836

Merged
merged 3 commits into from
Sep 28, 2019

Conversation

ueshin
Copy link
Collaborator

@ueshin ueshin commented Sep 27, 2019

DataFrame.__iter__() returns an iterator of columns.

And explicitly disable __iter__() with a proper error message for Series and Index.

>>> list(ks.Series([1,2,3]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ueshin/workspace/databricks-koalas/master/databricks/koalas/series.py", line 3131, in __iter__
    return _MissingPandasLikeSeries.__iter__(self)
  File "/Users/ueshin/workspace/databricks-koalas/master/databricks/koalas/missing/__init__.py", line 24, in unsupported_function
    reason=reason)
databricks.koalas.exceptions.PandasNotImplementedError: The method `pd.Series.__iter__()` is not implemented. If you want to collect your data as an NumPy array, use 'to_numpy()' instead.

Resolves #555.

@ueshin ueshin changed the title Disable __iter__(). Explicitly disable __iter__(). Sep 27, 2019
@ueshin ueshin changed the title Explicitly disable __iter__(). Support __iter__() for DataFrame and explicitly disable __iter__() for Series and Index. Sep 27, 2019
@ueshin ueshin changed the title Support __iter__() for DataFrame and explicitly disable __iter__() for Series and Index. Support __iter__() for DataFrame and explicitly disable for Series and Index. Sep 27, 2019
@softagram-bot
Copy link

Softagram Impact Report for pull/836 (head commit: 12e9496)

⭐ Change Overview

Showing the changed files, dependency changes and the impact - click for full size
(Open in Softagram Desktop for full details)

⭐ Details of Dependency Changes

details of dependency changes - click for full size
(Open in Softagram Desktop for full details)

💡 Insights

  • Co-change Alert: You modified frame.py. Often test_dataframe.py (koalas/tests) is modified at the same time.

📄 Full report

Impact Report explained. Give feedback on this report to [email protected]

@HyukjinKwon HyukjinKwon merged commit 2befad9 into databricks:master Sep 28, 2019
@ueshin ueshin deleted the disable_iter branch September 28, 2019 01:51
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.

unique() has wrong return type
3 participants