I'm taking an online class to learn python and the instructor taught us that chain indexing was not a good idea. However, he failed to tell is the appropriate alternative to use.
Suppose I have a Pandas data frame with rows indexed as ['1', '2', '3']
and columns with names ['a', 'b', 'c']
.
What's the appropriate alternative to using the command df['1']['a']
to extract the value found in the first row and first column?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…