#df
index a b c
1 2 3 4
2 3 4 5
Please help me how to extract columns "a" and "c" with all the rows but without the index column.
df[["a","c"]] # But index no. is also coming, so how to remove the index no.?
#df
index a b c
1 2 3 4
2 3 4 5
df[["a","c"]] # But index no. is also coming, so how to remove the index no.?
DataFrames and Series will always have an index, you can use:
df[["a","c"]].values
output:
array([[2, 4],
[3, 5]], dtype=int64)