Recently began branching out from my safe place (R) into Python and and am a bit confused by the cell localization/selection in Pandas
. I've read the documentation but I'm struggling to understand the practical implications of the various localization/selection options.
.loc
or .iloc
over the most general option .ix
? .loc
, iloc
, at
, and iat
may provide some guaranteed correctness that .ix
can't offer, but I've also read where .ix
tends to be the fastest solution across the board. .ix
?loc: only work on index
iloc: work on position
ix: You can get data from dataframe without it being in the index
at: get scalar values. It's a very fast loc
iat: Get scalar values. It's a very fast iloc
http://pyciencia.blogspot.com/2015/05/obtener-y-filtrar-datos-de-un-dataframe.html
Note: As of pandas 0.20.0
, the .ix
indexer is deprecated in favour of the more strict .iloc
and .loc
indexers.