keep/slice specific columns in pandas
If your column names have information that you can filter for, you could use df.filter(regex='name*').
I am using this to filter between my 189 data channels from a1_01 to b3_21 and it works fine.
I know about these column slice methods:
df2 = df[["col1", "col2", "col3"]] and df2 = df.ix[:,0:2]
but I'm wondering if there is a way to slice columns from the front/middle/end of a dataframe in the same slice without specifically listing each one.
For example, a dataframe df with columns: col1, col2, col3, col4, col5 and col6.
Is there a way to do something like this?
df2 = df.ix[:, [0:2, "col5"]]
I'm in the situation where I have hundreds of columns and routinely need to slice specific ones for different requests.  I've checked through the documentation and haven't seen something like this.  Have I overlooked something?