iloc select columns code example
Example 1: pandas iloc select certain columns
dataframe.iloc[:,[1,2]]
Example 2: isolate row based on index pandas
dfObj.iloc[: , [0, 2]]
Example 3: how to use loc and iloc in pandas
>>> df.iloc[0, 1]
2
dataframe.iloc[:,[1,2]]
dfObj.iloc[: , [0, 2]]
>>> df.iloc[0, 1]
2