Skip to content

BUG: loc indexing when starting with an empty frame #6252

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

Closed
jreback opened this issue Feb 4, 2014 · 0 comments · Fixed by #6256
Closed

BUG: loc indexing when starting with an empty frame #6252

jreback opened this issue Feb 4, 2014 · 0 comments · Fixed by #6256
Assignees
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Feb 4, 2014

from ML: https://groups.google.com/forum/#!topic/pydata/P3JFE3sob1U
empty indexing the frame

keys1 = ['@' + str(i) for i in range(1000)]
val1 = arange(1000)

keys2 = ['@' + str(i) for i in range(990)]
val2 = arange(990)

allKeys = list(set(keys1).union(keys2))
df = pandas.DataFrame(index = allKeys)
df['A'] = nan
df.loc[keys1, 'A'] = val1

df['B'] = nan
df.loc[keys2, 'B'] = val2

df.head()

## -- End pasted text --
                        <43>
        A    B
@679  679  679
@678  678  678
@337  337  337
@744  744  744
@673  673  673
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant