On Tue, Sep 29, 2020 at 8:02 AM Sebastian Kreft <[email protected]> wrote:
> But in some instance, there is more than one way to interpolate, so it > would be great to have: > >> >> sea_surface_temp[-78.123, 28.432, interp='linear'] >> > > I presume you would only use this to get the temperature and not to set or > delete measurements. Is that correct? > yes. working with this gridded data is pretty much a one-way street. If you want to change the values, you really need to work with the underlying arrays. Though now you mention it, I may think about that some more -- maybe there's something that could be done there? I haven't thought about it because I (nor any of my users) don't have a use case for that. -CHB > > >> >> and that would require having mixed positional and keyword index >> parameters. >> >> -CHB >> >> On Sun, Sep 27, 2020 at 6:48 PM Stephan Hoyer <[email protected]> wrote: >> >>> On Sat, Sep 26, 2020 at 8:40 PM Steven D'Aprano <[email protected]> >>> wrote: >>> >>>> On Sat, Sep 26, 2020 at 01:47:56PM -0300, Sebastian Kreft wrote: >>>> >>>> > In this fashion have you considering having keyword only indices, >>>> that is >>>> > to only allow either obj[1, 2] or obj[row=1, col=2] (if the class >>>> supports >>>> > it), and disallow mixing positional and keyword indices, meaning >>>> obj[1, >>>> > col=2] would be a SyntaxError. >>>> >>>> That would severely reduce the usefulness of this feature for me, >>>> probably by 80 or 90%, and possibly make it useless for xarray and >>>> pandas. >>>> >>>> (I don't speak for the pandas or xarray devs, I'm happy to be >>>> corrected.) >>> >>> >>> From my perspective as a developer for both xarray and pandas, both >>> "mixed" and "keyword only" indexing have use cases, but I would guess >>> keyword only indexing is more important. >>> >>> In xarray, we currently have methods that awkwardly approximate keyword >>> only indexing (e.g., xarray.DataArray.sel() and xarray.DataArray.isel() >>> both allow for named dimensions with **kwargs), but nothing for the "mixed" >>> case (neither method supports positional *args). >>> _______________________________________________ >>> Python-ideas mailing list -- [email protected] >>> To unsubscribe send an email to [email protected] >>> https://mail.python.org/mailman3/lists/python-ideas.python.org/ >>> Message archived at >>> https://mail.python.org/archives/list/[email protected]/message/IPEP5YXUQKCNCARJH4NKF7I757M7XLCA/ >>> Code of Conduct: http://python.org/psf/codeofconduct/ >>> >> >> >> -- >> Christopher Barker, PhD >> >> Python Language Consulting >> - Teaching >> - Scientific Software Development >> - Desktop GUI and Web Development >> - wxPython, numpy, scipy, Cython >> _______________________________________________ >> Python-ideas mailing list -- [email protected] >> To unsubscribe send an email to [email protected] >> https://mail.python.org/mailman3/lists/python-ideas.python.org/ >> Message archived at >> https://mail.python.org/archives/list/[email protected]/message/UBQS7YPOS3KD4PBPTWOBTKXOS6QSEAM7/ >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > > > -- > Sebastian Kreft > -- Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/LHZYX2KQF4M4RKZTR2PEBCG2TZXQV35I/ Code of Conduct: http://python.org/psf/codeofconduct/
