Comments (5)
You can pickle the ObsCollection/Observations using the to_pickle()
method. Loading these using
pandas (pd.read_pickle()
) will give you back the original ObsCollection or Observation. Maybe that solves your issue somewhat?
I'm all for a generic human-readable export format for Observations. I'd suggest some kind of CSV format that includes some information about its Obs type(?). Then I guess we need to the define some kind of header format and then write the time series data below that. If we want to attempt to maintain data types on import, that will be a bit of a challenge. An ObsCollection could then just use that Observation export format to write CSV files for each Observation in the collection.
If anyone else has any suggestions regarding this topic, feel free to post them here.
from hydropandas.
Thank you David, this answers my question. After reading back the pickled object, I even get an ObsCollection object instead of the DataFrame I had expected. Magic still happens, apparently.
from hydropandas.
Hahaha, I had the same first reaction when the pd.read_pickle()
returned an ObsCollection object. It is magic!
There is also a to_excel()
method for an ObsCollection. This will create an excel file with one tab with all the metadata and another tab for each observation object with the measurement time series. This is imo the best way to export to a human-readable format. Unfortunately we don't have a read_excel()
method yet for an ObsCollection but I think it is not too hard to create one.
from hydropandas.
Maybe we can create a simple hpd.ObsCollection.from_pickle()
method that calls pandas.read_pickle()
? To increase findability.
from hydropandas.
I've added a read_excel
and read_pickle
function to hydropandas. I updated the example notebook 01_groundwater_observations with calls to the excel and pickle functions for an ObsCollections.
from hydropandas.
Related Issues (20)
- Test should return `None` HOT 1
- KNMI neerslagstation Heibloem not available HOT 1
- reading the BRO data from XML files HOT 7
- Spline interpolation for any ObsCollection HOT 1
- Popped metadata in the Obs class (in the 'from_bro' function) gives KeyError when making interactive map HOT 2
- Create Obs object from another Obs object
- REGIS OSerror HOT 2
- Add option to read thresholds from FEWS xml
- .plots.section_plot: better xlim's HOT 3
- read_dino from zipfile eats disk space HOT 4
- Add option to allow for different ObsClasses in FEWS xml reader HOT 1
- Unknown Grondwaterstanden_Put Dino format HOT 4
- Get Hydropandas time series observations from rasters (xarray Datasets / DataArrays)
- Create `_repr_html_` for Obs and ObsCollection classes HOT 2
- Add `compare` method to Obs and ObsCollection class
- add waterinfo api HOT 4
- Add example to build Obs objects and an ObsCollection from scratch HOT 2
- Add option to retrieve and visualise borehole data from BRO wells
- Allow single setting to be passed to read_knmi HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hydropandas.