Super Users,
I have a multi index dataframe, that looks like this:
DATA
DATETIME PLATFORM OBTYPE LONGITUDE LATITUDE PRESSURE
2014-12-01 GPSRO ba 164.87 -16.22 0.2086 -1.080487
-99.87 51.67 433.9650 9.404006
-99.84 51.66 447.1593 8.621209
-99.82 51.65 460.5582 9.060276
-99.78 51.63 474.2856 4.033578
-99.75 51.62 488.2451 -3.564176
-99.72 51.61 502.6438 2.418914
-99.71 51.60 517.6590 9.504872
-99.68 51.59 533.0165 2.074352
-99.63 51.57 548.5572 1.692488
-99.61 51.56 564.5204 1.287064
-99.58 51.55 581.1121 2.060976
... ...
-98.81 51.25 885.3300 1.078527
-98.79 51.24 911.0555 -6.613088
-98.66 51.20 936.2419 4.369489
-98.61 51.18 962.0027 4.806168
-98.60 51.17 989.4301 -9.383631
The LATITUDE column has values from -90 to +90 The LONGITUDE column has values from 0 to 360 The DATA column is the observed value at the observed latitude and longitude
I want to create a new DataFrame that contains a 1-deg by 1-deg box average of the DATA The new DataFrame will look something like this:
DATA
DATETIME PLATFORM OBTYPE LONGITUDE LATITUDE PRESSURE
2014-12-01 GPSRO ba 0.0 -89.50 0.2086 -1.080487
-88.50 474.2856 4.033578
-87.50 488.2451 -3.564176
... ...
1.0 -89.50 0.2086 -1.080487
-88.50 474.2856 4.033578
-87.50 488.2451 -3.564176
... ...
so on and so forth.
What is the best and efficient way to do this in pandas?
Thanks
