Comments (11)
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.
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.
Was the issue resolved?
from openio-canada.
from openio-canada.
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.
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.
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.
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.
Try to first create the file on the C disk. That might be the reason
from openio-canada.
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.
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)
- International imports HOT 1
- Classifications available
- Industry by industry with final demand disaggregated
- Water use to water consumption
- Land use data
- Special Session Open Source IO at IIOA 2023 HOT 2
- Use for independent project HOT 3
- if you please write the tables names as written in demo what are these tables it will help. Thanks HOT 1
- consumption emissions (MtCO2eq) HOT 9
- Getting error when endogenizing_capitals=True with 2017 run only, 2018 and 2019 works fine. HOT 4
- How I can call and use this function. Please help. thanks HOT 2
- Inter-provincial trade emmisions HOT 3
- Loading error when following the demo HOT 10
- production and consumption comparision HOT 2
- error on version 2.8 HOT 2
- Currency question HOT 4
- Consumption Approach Validation HOT 2
- Zero emission sectors HOT 4
- Model does not run properly for years prior to 2016 (included) 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 openio-canada.