home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 186065185

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/pull/668#issuecomment-186065185 https://api.github.com/repos/pydata/xarray/issues/668 186065185 MDEyOklzc3VlQ29tbWVudDE4NjA2NTE4NQ== 2443309 2016-02-19T05:40:25Z 2016-02-19T05:40:25Z MEMBER

Okay, _full_like (formerly empty_like) has been made private. I think it will be a useful feature for a bunch of applications but its not the point here. I'd like to build out functionality akin to what @shoyer indicated (zeros_like, ones_like, and missing_like). Actually, that can all be done by _full_like as it stands but it sounds like we need to put some more thought into the API before making it public.

An example of how we differ from Pandas in the last position with center=True. This stems from how we "center" the data using shift.

``` Python In [7]: arr Out[7]: <xarray.DataArray (y: 5)> array([ 2.5, 3. , 3.5, 4. , 4.5]) Coordinates: x int64 1 * y (y) int64 0 1 2 3 4

In [8]: arr.rolling(y=3, center=True, min_periods=1).mean() Out[8]: <xarray.DataArray (y: 5)> array([ 2.75, 3. , 3.5 , 4. , nan]) Coordinates: x int64 1 * y (y) int64 0 1 2 3 4

In [9]: pd.rolling_mean(arr.to_series(), 3, center=True, min_periods=1) Out[9]: y 0 2.75 1 3.00 2 3.50 3 4.00 4 4.25 dtype: float64 ```

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