Re: How to save xarray data to csv

2018-04-17 Thread Rhodri James
On 17/04/18 03:25, shalu.ash...@gmail.com wrote: My question is how can i save multi-dimentional (3d: time series values, lat, long) data (xarrays) into csv. What do you want each line of the CSV file to look like? That's the key question. Once you know that you can arrange your data into

Re: How to save xarray data to csv

2018-04-16 Thread shalu . ashu50
On Tuesday, 17 April 2018 01:56:25 UTC+8, Rhodri James wrote: > On 16/04/18 15:55, shalu.ash...@gmail.com wrote: > > Hello All, > > > > I have used xarray to merge several netcdf files into one file and then I > > subset the data of my point of interest using lat/long. Now I want to save > >

Re: How to save xarray data to csv

2018-04-16 Thread shalu . ashu50
On Tuesday, 17 April 2018 02:01:19 UTC+8, Chris Angelico wrote: > On Tue, Apr 17, 2018 at 3:50 AM, Rhodri James wrote: > > You don't say, but I assume you're using Python 2.x > > > > [snip] > > > >> getting this error - TypeError: a bytes-like object is required, not 'str'

Re: How to save xarray data to csv

2018-04-16 Thread Chris Angelico
On Tue, Apr 17, 2018 at 3:50 AM, Rhodri James wrote: > You don't say, but I assume you're using Python 2.x > > [snip] > >> getting this error - TypeError: a bytes-like object is required, not 'str' Actually, based on this error, I would suspect Python 3.x. But you're right

Re: How to save xarray data to csv

2018-04-16 Thread Rhodri James
On 16/04/18 15:55, shalu.ash...@gmail.com wrote: Hello All, I have used xarray to merge several netcdf files into one file and then I subset the data of my point of interest using lat/long. Now I want to save this array data (time,lat,long) into csv file but I am getting an error with my

How to save xarray data to csv

2018-04-16 Thread shalu . ashu50
Hello All, I have used xarray to merge several netcdf files into one file and then I subset the data of my point of interest using lat/long. Now I want to save this array data (time,lat,long) into csv file but I am getting an error with my code: dsmerged =