I am trying to extract the 7th to 14th columns in a data frame. However
df[0:3]
only gives the 1st to 3rd rows.
Does anyone knows what should I do if I want to find out the columns?
I know how to do it with column names such as df['a']
but as the names are too many, I just want to type something like df[,7:14]
in R.
Thanks in advance.
Looks that I found it....
By using iloc..
df.iloc[:,your_col_index]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With