ColumnMetadata¶
- class ColumnMetadata(column_type=None, name=None, source=None)[source]
Column in a ColumnMapper.
Methods
A single column entry in the column mapper. |
|
|
Return how many pound signs a column string should have. |
Returns the hed strings for this entry as a series. |
|
|
Sets the hed strings for this entry. |
Attributes
The hed strings for any given entry. |
|
The raw dict for this entry(if it exists) |
- ColumnMetadata.__init__(column_type=None, name=None, source=None)[source]¶
A single column entry in the column mapper.
- Parameters:
column_type (ColumnType or None) – How to treat this column when reading data.
name (str, int, or None) – The column_name or column number identifying this column. If name is a string, you’ll need to use a column map to set the number later.
source (dict or str or None) – Either the entire loaded json sidecar or a single HED string
- static ColumnMetadata.expected_pound_sign_count(column_type)[source]¶
Return how many pound signs a column string should have.
- Parameters:
column_type (ColumnType) – The type of the column
- Returns:
expected_count(int): The expected count. 0 or 1 error_type(str): The type of the error we should issue
- Return type:
tuple
- ColumnMetadata.get_hed_strings()[source]¶
Returns the hed strings for this entry as a series.
- Returns:
the hed strings for this series.(potentially empty)
- Return type:
hed_strings(pd.Series)
- ColumnMetadata.set_hed_strings(new_strings)[source]¶
Sets the hed strings for this entry.
- Parameters:
new_strings (pd.Series, dict, or str) – The hed strings to set. This should generally be the return value from get_hed_strings
- Returns:
the hed strings for this series.(potentially empty)
- Return type:
hed_strings(pd.Series)
- ColumnMetadata.hed_dict¶
The hed strings for any given entry.
- Returns:
A string or dict of strings for this column
- Return type:
dict or str
- ColumnMetadata.source_dict¶
The raw dict for this entry(if it exists)
- Returns:
A string or dict of strings for this column
- Return type:
dict or str