Consider the following data:
61 1 1 15.04 14.96 13.17 9.29 13.96 9.87 13.67 10.25 10.83 12.58 18.50 15.04 61 1 2 14.71 16.88 10.83 6.50 12.62 7.67 11.50 10.04 9.79 9.67 17.54 13.83 61 1 3 18.50 16.88 12.33 10.13 11.17 6.17 11.25 8.04 8.50 7.67 12.75 12.71
The first three columns are year, month and day.
The remaining 12 columns are average windspeeds in knots at 12 locations in a country on that day.
What I want to do is lose the 2nd and 3rd column (index 1 and 2) so that I get the following data:
61 15.04 14.96 13.17 9.29 13.96 9.87 13.67 10.25 10.83 12.58 18.50 15.04 61 14.71 16.88 10.83 6.50 12.62 7.67 11.50 10.04 9.79 9.67 17.54 13.83 61 18.50 16.88 12.33 10.13 11.17 6.17 11.25 8.04 8.50 7.67 12.75 12.71
The following works but I dont like it as it wont scale if I had lots of columns (ie many locations) in the data.
import numpy as np
data = np.loadtxt('wind.data')
data_nomonth_noday = data[:,[0,3,4,5,6,7,8,9,10,11,12,13,14]]
Is it possible to achieve it without enumerating the column numbers ? Can I achieve it with slicing ?