This post introduces the differences among iloc, ix, and loc.
Note: in pandas version > = 0.20.0,
ix is deprecated . Thus, use
loc— gets rows (or columns) with particular labels from the index.
iloc— gets rows (or columns) at particular positions in the index (so it only takes integers).
ix— usually behaves like
locbut falls back to behaving like
ilocif a label is not present in the index.