Skip to content

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

Merged
HyukjinKwon merged 3 commits into
databricks:masterfrom
ueshin:disable_iter
Sep 28, 2019
Merged

Support __iter__() for DataFrame and explicitly disable for Series and Index.#836
HyukjinKwon merged 3 commits into
databricks:masterfrom
ueshin:disable_iter

Conversation

@ueshin
Copy link
Copy Markdown
Contributor

@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 requested review from HyukjinKwon and rxin September 27, 2019 22:15
@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
Copy Markdown

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 support@softagram.com

@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