[
https://issues.apache.org/jira/browse/SPARK-52592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Peter Nguyen updated SPARK-52592:
---------------------------------
Priority: Major (was: Minor)
> Can't construct ps.Series from a ps.Series
> ------------------------------------------
>
> Key: SPARK-52592
> URL: https://issues.apache.org/jira/browse/SPARK-52592
> Project: Spark
> Issue Type: Bug
> Components: Pandas API on Spark
> Affects Versions: 3.2.0
> Reporter: Peter Nguyen
> Priority: Major
>
> I'd like for this to work, but it does not.
> {code:python}
> obj = ps.Series([x for x in range(3)])
> obj = ps.Series(obj) print(obj)
> {code}
>
> Here's the error:
> {code:java}
> Traceback (most recent call last):
> File "script.py", line 75, in <module>
> obj = ps.Series(obj)
> File ".../pyspark/pandas/series.py", line 422, in __init__
> s = pd.Series(
> File ".../pandas/core/series.py", line 470, in __init__
> data = sanitize_array(data, index, dtype, copy)
> File ".../pandas/core/construction.py", line 618, in sanitize_array
> data = list(data)
> File ".../pyspark/pandas/series.py", line 7339, in __iter__
> return MissingPandasLikeSeries.__iter__(self)
> File ".../pyspark/pandas/missing/__init__.py", line 23, in
> unsupported_function
> raise PandasNotImplementedError(
> pyspark.pandas.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.
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]