Giter Site home page Giter Site logo

Comments (11)

rehananis avatar rehananis commented on May 26, 2024 1

thanks for your help. Your openIO is very useful for me to understand the IO Tables and do some analysis. thank you again for your quick response.

from openio-canada.

MaximeAgez avatar MaximeAgez commented on May 26, 2024

Hi @rehananis. Do you have the pandas package to the specified version in the requirements.txt file? I believe this error arises with newer version of pandas.

from openio-canada.

MaximeAgez avatar MaximeAgez commented on May 26, 2024

Was the issue resolved?

from openio-canada.

rehananis avatar rehananis commented on May 26, 2024

from openio-canada.

MaximeAgez avatar MaximeAgez commented on May 26, 2024

Yeah the export function is outdated. You can use the pickle format to store all dataframes from the system and reload everything

import pickle
import gzip

with gzip.open("path_where_to_store_the_data","rb") as f:
     pickle.dump(self, f)

You can then reimport the saved system with:

with gzip.open("path_where_to_store_the_data","wb") as f:
     self = pickle.load(f)

from openio-canada.

rehananis avatar rehananis commented on May 26, 2024

Hi, thanks for your help but I am still unable to export results.
File "", line 4
with gzip.open("F:\carbon","rb") as f:
^
SyntaxError: EOL while scanning string literal

from openio-canada.

MaximeAgez avatar MaximeAgez commented on May 26, 2024

When using the \ instead of the /, you need to add r in front of the path. Also you should create a .gz.pickle file so add .gz.pickle at the end of your file path such as:
with gzip.open(r"F:\carbon\openio.gz.pickle","rb") as f:

from openio-canada.

rehananis avatar rehananis commented on May 26, 2024

import pickle
import gzip

with gzip.open("F:/carbon/openio.gz.pickle", 'rb') as f:
pickle.dump(self, f)

FileNotFoundError Traceback (most recent call last)
in
2 import gzip
3
----> 4 with gzip.open("F:/carbon/openio.gz.pickle", 'rb') as f:
5 pickle.dump(self, f)

c:\users\rehan\appdata\local\programs\python\python39\lib\gzip.py in open(filename, mode, compresslevel, encoding, errors, newline)
56 gz_mode = mode.replace("t", "")
57 if isinstance(filename, (str, bytes, os.PathLike)):
---> 58 binary_file = GzipFile(filename, gz_mode, compresslevel)
59 elif hasattr(filename, "read") or hasattr(filename, "write"):
60 binary_file = GzipFile(None, gz_mode, compresslevel, filename)

c:\users\rehan\appdata\local\programs\python\python39\lib\gzip.py in init(self, filename, mode, compresslevel, fileobj, mtime)
171 mode += 'b'
172 if fileobj is None:
--> 173 fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
174 if filename is None:
175 filename = getattr(fileobj, 'name', '')

FileNotFoundError: [Errno 2] No such file or directory: 'F:/carbon/openio.gz.pickle'

from openio-canada.

MaximeAgez avatar MaximeAgez commented on May 26, 2024

Try to first create the file on the C disk. That might be the reason

from openio-canada.

rehananis avatar rehananis commented on May 26, 2024

I solve it to save use

import pickle
import gzip

with gzip.open("F:/carbon/openio1.gz.pickle", 'wb') as f:
pickle.dump(tables, f)

from openio-canada.

rehananis avatar rehananis commented on May 26, 2024

I use this to reload in another file sucessfully
import sys
sys.path.append('F://carbon/')
import openIO
import pandas as pd
import numpy as np

with gzip.open("F:/carbon/openio.gz.pickle", 'rb') as f:
tables = pickle.load(f)

from openio-canada.

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.