bw2data.backends.iotable.backend#
Classes#
IO tables have too much data to store each value in a database; instead, we only store the processed data in NumPy arrays. |
Module Contents#
- class bw2data.backends.iotable.backend.IOTableBackend(*args, **kwargs)[source]#
Bases:
bw2data.backends.SQLiteBackend
IO tables have too much data to store each value in a database; instead, we only store the processed data in NumPy arrays.
Activities will not seem to have any exchanges.
- edges_to_dataframe() pandas.DataFrame [source]#
Return a pandas DataFrame with all database exchanges. DataFrame columns are:
target_id: int, target_database: str, target_code: str, target_name: Optional[str], target_reference_product: Optional[str], target_location: Optional[str], target_unit: Optional[str], target_type: Optional[str] source_id: int, source_database: str, source_code: str, source_name: Optional[str], source_product: Optional[str], # Note different label source_location: Optional[str], source_unit: Optional[str], source_categories: Optional[str] # Tuple concatenated with β::β as in bw2io edge_amount: float, edge_type: str,
Target is the node consuming the edge, source is the node or flow being consumed. The terms target and source were chosen because they also work well for biosphere edges.
As IO Tables are normally quite large, the DataFrame building will operate directly on Numpy arrays, and therefore special formatters are not supported in this function.
Returns a pandas
DataFrame
.
- write(data, process=False, searchable=True, check_typos=True)[source]#
Write
data
to database.data
must be a dictionary of the form:{ ('database name', 'dataset code'): {dataset} }
Writing a database will first deletes all existing data.