python - How to select n-1 column in a dataframe -


we need select n-l column n column in dataframe using python have tried method

sample code

x = dataframe1[['col1,col2......n']] 

is there other way around

if have pandas dataframe df column names ['col1', 'col2', ...] can like:

df.ix[:,'col2':] # select col2, col3, ... 

or

df.ix[:,:'col4'] # select col1, col2, col3 , col4 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -