SequenceMap¶
- class SequenceMap(codes=None, name='')[source]
A map of unique sequences of column values of a particular length appear in a columnar file.
- name
An optional name of this remap for identification purposes.
- Type:
str
Notes: This mapping converts all columns in the mapping to strings. The remapping does not support other types of columns.
Methods
|
Information for setting up the maps. |
|
Produce a DOT string representing this sequence map. |
Convert a graph edge to a DOT string. |
|
|
Return a DOT format edge list with the option of sorting by edge counts. |
|
Remove quotes from the specified columns and convert to string. |
|
Update the existing map with information from data. |
Attributes
- SequenceMap.__init__(codes=None, name='')[source]¶
Information for setting up the maps.
- Parameters:
codes (list or None) – If None use all codes, otherwise only include listed codes in the map.
name (str) – Name associated with this remap (usually a pathname of the events file).
- SequenceMap.edge_to_str(key)[source]¶
Convert a graph edge to a DOT string.
- Parameters:
key (str) – Hashcode string representing a graph edge.
- SequenceMap.get_edge_list(sort=True)[source]¶
Return a DOT format edge list with the option of sorting by edge counts.
- Parameters:
sort (bool) – If True (the default), the edge list is sorted by edge counts.
- Returns:
list of DOT strings representing the edges labeled by counts.
- Return type:
list
- static SequenceMap.prep(data)[source]¶
Remove quotes from the specified columns and convert to string.
- Parameters:
data (Series) – Dataframe to process by removing quotes.
Returns: Series .. rubric:: Notes
Replacement is done in place.
- SequenceMap.update(data)[source]¶
Update the existing map with information from data.
- Parameters:
data (Series) – DataFrame or filename of an events file or event map.
allow_missing (bool) – If True allow missing keys and add as n/a columns.
- Raises:
If there are missing keys and allow_missing is False.