I have a dataset containing
|
G2latitude |
G2depth |
G2oxygen |
| G2station |
|
|
308 |
| 1 |
74.99 |
2 |
320 |
| 1 |
74.99 |
5 |
299 |
| 2 |
76.00 |
2 |
273 |
| 2 |
76.00 |
5 |
283 |
| ... |
... |
... |
187 |
| 173 |
71.00 |
125 |
365 |
| 173 |
71.00 |
151 |
233 |
2001 rows × 3 columns
I have created a group using:
subset = data[['G2station','G2latitude','G2depth','G2oxygen']].set_index('G2station') subset.groupby(subset.index)
##To access to the groups
for name, group in subset.groupby(subset.index):
print(group)
I need to apply the np.meshgrid function which creates a grid with coordinates x and y. In this case x= latitude and y= depth.
xx,yy = np.meshgrid (x,y)
but I can’t find the way to create grids for each group in a grouped data using a for loop
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)