I come from an R background and am having trouble slicing certain sets of columns in pandas.
Let's say I am trying to get the columns with index 0, 3, 5 through 20, and 25th. I would think the way to access what I want is:
df.iloc[:, [0,3,5:20,25]]
but there is a syntax error with the :
within the 5:20
line of code. Is there a way to generate a sequence of numbers from 5 through 20 without typing each number out?