I have data in different columns but I don\'t know how to extract it to save it in another variable.
index a b c
1 2 3 4
2 3 4 5
To select multiple columns, extract and view them thereafter: df
is previously named data frame, than create new data frame df1
, and select the columns A to D which you want to extract and view.
df1 = pd.DataFrame(data_frame, columns=['Column A', 'Column B', 'Column C', 'Column D'])
df1
All required columns will show up!