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

Allow direct assignment in DataFrame.index #643

Open
HyukjinKwon opened this issue Aug 13, 2019 · 1 comment
Open

Allow direct assignment in DataFrame.index #643

HyukjinKwon opened this issue Aug 13, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@HyukjinKwon
Copy link
Member

Pandas allows assignment to DataFrame.index

>>> import pandas as pd
>>> df = pd.DataFrame({'a': [1, 2, 3]})
>>> df.index = ['a', 'b', 'c']
>>> df
   a
a  1
b  2
c  3

whereas Koalas seems unable.

>>> import databricks.koalas as ks
>>> df = ks.DataFrame({'a': [1, 2, 3]})
>>> df.index = ['a', 'b', 'c']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: can't set attribute
@HyukjinKwon HyukjinKwon self-assigned this Aug 13, 2019
@HyukjinKwon HyukjinKwon added the enhancement New feature or request label Aug 13, 2019
@HyukjinKwon
Copy link
Member Author

This seems to be difficult because the operations between different DataFrames are dependent on index.

df.index and ['a', 'b', 'c'] are different datasets so we should figure out a way to join both by a certain axis column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant