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/1534#issuecomment-325447523,https://api.github.com/repos/pydata/xarray/issues/1534,325447523,MDEyOklzc3VlQ29tbWVudDMyNTQ0NzUyMw==,1197350,2017-08-28T19:03:09Z,2017-08-28T19:03:09Z,MEMBER,"Marinna,
You are correct. In the present release of Xarray, converting to a pandas
dataframe loads all of the data eagerly into memory as a regular pandas
object, giving up dask's parallel capabilities and potentially consuming
lots of memory. With chunked Xarray data, It would be preferable instead to
convert to a dask.dataframe, rather than a regular pandas dataframe, which
would carry over some of the performance benefits.
This is a known issue:
https://github.com/pydata/xarray/issues/1462
With a solution in the works:
https://github.com/pydata/xarray/pull/1489
So hopefully a release of Xarray in the near future will have the feature
you seek.
Alternatively, if you describe the filtering, masking, and other QA/QC that
you need to do in more detail, we may be able to help you accomplish this
entirely within Xarray.
Good luck!
Ryan
On Mon, Aug 28, 2017 at 2:02 PM, Marinna Martini
wrote:
> Apologies for what is probably a very newbie question:
>
> If I convert such a large file to pandas using to_dataframe() to gain
> access to more pandas methods, will I lose the speed and dask capabillity
> that is so wonderful in xarray?
>
> I have a very large netCDF file (3 GB with 3 Million data points of 1-2 Hz
> ADCP data) that needs to be reduced to hourly or 10 min averages. xarray is
> perfect for this. I am exploring resample and other methods. It is
> amazingly fast doing this:
>
> ds = xr.open_dataset('hugefile.nc')
> ds_lp = ds.resample('H','time','mean')
>
> And an offset of about half a day is introduced to the data. Probably user
> error or due to filtering. To figure this out, I am looking at using
> resample in pandas directly, or multindexing and reshaping using methods
> that are not inherited from pandas by xarray, then back to xarray using
> to_xarray. I will also need to be masking data (and other things pandas can
> do) during a QA/QC process. It appears that pandas can do masking and
> xarray does not inherit masking?
>
> Am I understanding the relationship between xarray and pandas correctly?
>
> Thanks,
> Marinna
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> , or mute the thread
>
> .
>
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,253407851