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

Dataframe index has not to be unique #1

Open
feralfer opened this issue Jun 21, 2022 · 1 comment
Open

Dataframe index has not to be unique #1

feralfer opened this issue Jun 21, 2022 · 1 comment

Comments

@feralfer
Copy link

Hie,
in your tuto you write "The index of a DataFrame is a set (i.e. each element is only represented once) that consists of a label for each row".
IMHO this is not true.
2 rows may have the same label
example :
data = [{'A': 'x', 'B': 'y', 'C':'z'}, {'A':'x', 'B': 'u', 'C': 'v'}]
df = pandas.DataFrame(data)
df.set_index(["A"])

@ZaxR
Copy link
Owner

ZaxR commented Jun 21, 2022

You're right - as it stands now, more accurate phrasing would be that the index of a DataFrame should be a set. While duplicating a value in the index is possible, it's both very slow and not well supported by the suite of index-based pandas functionality (read: expect errors).

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

No branches or pull requests

2 participants