-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves
Milestone
Description
I didn't expect the last line of code to pass.
import numpy as np
import pandas as pd
pd.__version__
#[Out]# '0.12.0.dev-5c3ccdb'
np.random.seed(33)
df = pd.DataFrame(np.random.random((3, 3)),
index=['a', 'b', 'c'],
columns=['e', 'f', 'g'])
# raise a KeyError?
df.loc[[1, 2], [1, 2]]
#[Out]# f g
#[Out]# b 0.870396 0.185040
#[Out]# c 0.953252 0.680451
Being strictly label based, shouldn't loc
fail when it doesn't find 1 or 2 as a label?
Metadata
Metadata
Assignees
Labels
BugIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves