home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 218663446

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/818#issuecomment-218663446 https://api.github.com/repos/pydata/xarray/issues/818 218663446 MDEyOklzc3VlQ29tbWVudDIxODY2MzQ0Ng== 1217238 2016-05-12T05:27:11Z 2016-05-12T06:34:17Z MEMBER

@naught101 I would consider changing:

python forcing_data.isel(lat=lat, lon=lon) .to_dataframe() .drop(['lat', 'lon'], axis=1)

to just forcing_data.isel(lat=lat, lon=lon).values, because there's no point in creating a DataFrame with a bunch of variables you wouldn't use -- pandas will be pretty wasteful in allocating this.

Otherwise that looks pretty reasonable, given the limitations of current groupby support. Now, ideally you could write something like instead:

``` python def make_prediction(forcing_data_time_series): predicted_values = model.predict(forcing_data_time_series.values) return xr.DataArray(predicted_values, [flux_vars, time])

forcing_data.groupby(['lat', 'lon']).dask_apply(make_prediction) ```

This would two the 2D groupby, and then apply the predict function in parallel with dask. Sadly we don't have this feature yet, though :).

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