pvpltools.dataplusmeta.DataPlusMeta#
- class pvpltools.dataplusmeta.DataPlusMeta(data=None, cdef=None, meta=None, source=None)[source]#
Class to bundle tabular data with metadata, with methods to read and write files.
Author: Anton Driesse, PV Performance Labs
- datapandas.DataFrame, default=None
Two-dimensional tabular data.
- cdefpandas.DataFrame, default=None
Column definitions for the tabular data. Should logically have one row for each column in data. (This may be enforced in file operations.)
- metadict, default=None
Dictionary containing any useful (or not) metadata. May contain lists and other nested dictionaries.
- sourcestr, default=None
Identifies the source of the data, if needed. Typically a file name.
Methods
__init__([data, cdef, meta, source])check_cdef([raise_on_mismatch])Check whether cdef is consistent with data.
from_txt(file[, use_dtypes])Read the contents of a text file to create a DataPlusMeta object.
to_txt(file[, update_cdef, preamble])Write the contents of a DataPlusMeta object to a text file.
update_cdef([raise_on_fail])Update the dtype column in cdef with dtype values found in data, or create a new cdef table and/or dtype column.