utils¶
The utils
module provides functions for general operations and plotting.
Functions
- poli_sci_kit.utils.gen_list_of_lists(original_list, new_structure)[source]¶
Generates a list of lists with a given structure from a given list.
- poli_sci_kit.utils.gen_faction_groups(original_list, factions_indexes)[source]¶
Reorders a list into a list of lists where sublists are faction amounts.
- Parameters:
- original_listlist
The data to be reorganized.
- factions_indexeslist of lists (contains ints)
The structure of original_list indexes to output.
- Returns:
- factioned_listlist of lists
The values of original_list ordered as the indexes of factions_indexes.
- poli_sci_kit.utils.hex_to_rgb(hex_rep)[source]¶
Converts a hexadecimal representation to its RGB ratios.
- Parameters:
- hex_repstr
The hex representation of the color.
- Returns:
- rgb_triptuple
An RGB tuple color representation.