New answers tagged

1

I think one of the most evident advantages is indexing. Consider the following example where you have data and both longitude and latitude stored in 2D arrays: data = np.random.randint(100, 1000, size=(4, 4)) data [[176, 479, 713, 973], [992, 259, 969, 355], [182, 139, 633, 938], [761, 911, 124, 855]] x = np.linspace(-76, -74.5, 4) y = np.linspace(-5.0,...


0

I ended up writing a function to parse the structured metadata attribute and add coordinates to a dataset. Here is my code to read in the dataset, create the coordinates, and apply it to the dataset: import xarray as xr import pyproj import numpy as np from collections import OrderedDict def parse_hdfeos_metadata(string): out = OrderedDict() lines = [i....


Top 50 recent answers are included