Let's say I have a file 'test.csv' containing the following headers and data:
h1 c1 h2 h3 c2
1 0 2 3 1
3 0 2 1 0
0 1 2 3 3
What is the best option in python to only select and save the columns of interest and discard all others?
Assuming I'm only interested in saving the h columns, I thought of something along these lines:
f = open('test.csv')
s = save('new_test.csv', data = f, saveColumns=['h1','h2','h3'])´
n = load('new_test.csv')
print n
h1 h2 h3
1 2 3
3 2 1
0 2 3