home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 75475215

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/328#issuecomment-75475215 https://api.github.com/repos/pydata/xarray/issues/328 75475215 MDEyOklzc3VlQ29tbWVudDc1NDc1MjE1 1217238 2015-02-23T00:30:02Z 2015-02-23T00:31:00Z MEMBER

support for interleaved concatenation (necessary for transformations by group, which are quite common)

Turns out what I was thinking of here can be written as a one liner in terms of concatenate and take:

def interleaved_concatenate(arrays, indices, axis=0): return np.take(np.concatenate(arrays, axis), np.concatenate(indices))

So I've crossed that one off the line.

support super-imposing array values inter-leaved on top of a constant array of NaN (necessary for many alignment operations)

What I need here is something similar to the private take_nd functions that pandas defines that works like np.take, but that uses -1 as a sentinel value for "missing":

``` In [1]: import pandas

In [2]: import numpy as np

In [3]: x = np.arange(5)

In [4]: pandas.core.common.take_nd(x, [0, -1, 1, -1, 2]) Out[4]: array([ 0., nan, 1., nan, 2.]) ```

(In xray, I implement this a little differently so that I can take along all multiple axes simultaneously using array indexing, but this version would suffice.)

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