Question: what is the difference between iloc and loc in python?
Answer: 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 tries to behave like loc but falls back to behaving like iloc if a label is not present in the index.