koalas icon indicating copy to clipboard operation
koalas copied to clipboard

DataFrame.reindex does not support named columns index

Open LucasG0 opened this issue 6 years ago • 0 comments

Hi, it seems currently not possible to reindex a DataFrame with a named columns Index, the new name is missing.

>>> pdf = pd.DataFrame({"values": [1, 2, 3]})
>>> pdf
   values
0       1
1       2
2       3
>>> kdf = ks.from_pandas(pdf)
>>> columns = pd.Index(["values"], name="name")
>>> kdf.reindex(columns=columns)
   values
0       1
1       2
2       3

But in pandas :

>>> pdf.reindex(columns=columns)
name  values
0          1
1          2
2          3

I will submit a PR for this.

LucasG0 avatar Oct 27 '20 19:10 LucasG0