home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 296409111

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/967#issuecomment-296409111 https://api.github.com/repos/pydata/xarray/issues/967 296409111 MDEyOklzc3VlQ29tbWVudDI5NjQwOTExMQ== 1217238 2017-04-22T23:50:05Z 2017-04-22T23:50:05Z MEMBER

If you pass in a list or array to isel, xarray copies the underling data like numpy does: http://xarray.pydata.org/en/stable/indexing.html#copies-vs-views

These approach do go do slightly different code paths, but they would have equivalent performance in most cases because the indexing cost will dominate over sorting. I would prefer using np.argsort() only because it's slightly more general, insofar as it doesn't rely on the index having unique labels. (If you have duplicate labels, reindex fails.) It also avoids needing to build the hash table for index based lookups, which has a small amount of overhead.

Also, as a side note np.sort and np.argsort are slightly faster than Python's sorted(), because can rely on homogeneous data dtypes.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  171077425
Powered by Datasette · Queries took 0.802ms · About: xarray-datasette