On Fri, Jul 17, 2020 at 12:19 PM David Mertz <me...@gnosis.cx> wrote:
> Fwiw, I'm probably -0 on the feature itself. Someone suggested it could be > useful for xarray, but I'm not sure now what that would look like. If > someone had an example, I could easily be moved. > Here is what it currently looks like to assign values to indices in xarray (adapted from a tutorial): ds["empty"].loc[dict(lon=5, lat=6)] = 10 This could be changed to: ds["empty"][lon=5, lat=6] = 10 This becomes even a bigger advantage if we include slicing, which I think we should: ds["empty"].loc[dict(lon=slice(1, 5), lat=slice(3, None))] = 10 to ds["empty"][lon=1:5, lat=6:] = 10
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/RZLZOUW5GUQDBBJCSOANGLTDTJCOJVGF/ Code of Conduct: http://python.org/psf/codeofconduct/