isolate row based on index pandas

dfObj.iloc[: , [0, 2]]

Here is what the above code is Doing:
1. We’re using the iloc method to select the first two columns of the dataframe.
2. We’re using the : symbol to select all the rows.
3. We’re using the comma to separate the columns we want to select.
4. We’re using the square brackets to select the columns we want.