Coder Social home page Coder Social logo

Comments (5)

dbrakenhoff avatar dbrakenhoff commented on August 16, 2024

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.

tdmeij avatar tdmeij commented on August 16, 2024

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.

OnnoEbbens avatar OnnoEbbens commented on August 16, 2024

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.

martinvonk avatar martinvonk commented on August 16, 2024

Maybe we can create a simple hpd.ObsCollection.from_pickle() method that calls pandas.read_pickle()? To increase findability.

from hydropandas.

OnnoEbbens avatar OnnoEbbens commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.