I am trying to find a better way to separate the first half of my dataframe which has a variable number of columns. I have tried using both the iloc and ix methods, but effectively I am writing the following for many dataframes. Is there a better way to shorthand this?
df.iloc[:, [0,1,2,3,4,5,6,7,8,9,10,11]] #df.ix works this way as well
What I'd like to do is below...
df.iloc[:, [0:df.shape[1]/2] #this will allow column number flexibility
Do any of you have an idea of a good workaround for this?