ColumnMetadata

class ColumnMetadata(column_type=None, name=None, source=None)[source]

Column in a ColumnMapper.

Methods

ColumnMetadata.__init__([column_type, name, ...])

A single column entry in the column mapper.

ColumnMetadata.expected_pound_sign_count(...)

Return how many pound signs a column string should have.

ColumnMetadata.get_hed_strings()

Return the HED strings for this entry as a series.

ColumnMetadata.set_hed_strings(new_strings)

Set the HED strings for this entry.

Attributes

ColumnMetadata.hed_dict

The HED strings for any given entry.

ColumnMetadata.source_dict

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]

Return 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]

Set 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