You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xinrong Meng (Jira)" <ji...@apache.org> on 2025/07/31 21:29:00 UTC

[jira] [Created] (SPARK-53050) MultiIndex.to_series() should return tuples for each entry

Xinrong Meng created SPARK-53050:
------------------------------------

             Summary: MultiIndex.to_series() should return tuples for each entry
                 Key: SPARK-53050
                 URL: https://issues.apache.org/jira/browse/SPARK-53050
             Project: Spark
          Issue Type: Sub-task
          Components: PS
    Affects Versions: 4.1.0
            Reporter: Xinrong Meng


MultiIndex.to_series() in pandas-on-Spark returns lists for each entry, whereas pandas returns tuples.


{code:python}
>>> arrays = [[1,  2], ["red", "blue"]]
>>> pidx = pd.MultiIndex.from_arrays(arrays, names=("number", "color"))
>>> psidx = ps.from_pandas(pidx)

>>> pidx.to_series()
number  color
1       red       (1, red)
2       blue     (2, blue)
dtype: object
>>> psidx.to_series()
number  color
1       red       [1, red]
2       blue     [2, blue]
dtype: object
{code}

that applies for both ANSI on and off



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org