cowidev.grapher.files¶
cowidev.grapher.files.explorer¶
- class cowidev.grapher.files.explorer.Exploriser(location: str = 'location', date: str = 'date', pivot_column: str = None, pivot_values: str = None, function_input: Callable = <function Exploriser.<lambda> at 0x7f90a956af70>, function_output: Callable = <function Exploriser.<lambda> at 0x7f90a94f20d0>)[source]¶
Bases:
object
- date: str = 'date'¶
- function_input()¶
- function_output()¶
- location: str = 'location'¶
- pivot_column: str = None¶
- pivot_values: str = None¶
cowidev.grapher.files.grapher¶
- class cowidev.grapher.files.grapher.Grapheriser(location: str = 'location', date: str = 'date', date_ref: datetime.datetime = datetime.datetime(2020, 1, 21, 0, 0), fillna: bool = False, fillna_0: bool = True, pivot_column: str = None, pivot_values: str = None, suffixes: list = None, function_input: Callable = <function Grapheriser.<lambda> at 0x7f90a955ce50>, function_output: Callable = <function Grapheriser.<lambda> at 0x7f90a955cee0>, columns_non_fillna_0: list = <factory>)[source]¶
Bases:
object
- property columns_metadata: list¶
- columns_non_fillna_0: list¶
- date: str = 'date'¶
- date_ref: datetime = datetime.datetime(2020, 1, 21, 0, 0)¶
- property do_pivot¶
- fillna: bool = False¶
- fillna_0: bool = True¶
- function_input()¶
- function_output()¶
- location: str = 'location'¶
- property metric2suffix: dict¶
- pipe_metadata_columns(df: DataFrame) DataFrame [source]¶
Rename columns and convert date to Year grapher metric.
- pipe_normalize_columns(df)[source]¶
Normalize column names.
If columns are multiindex (of length 2), use first and second positions to create new column name.
This only applies if pivot has been done, i.e. pivot_column and pivot_values are not None.
- pipe_order_columns(df: DataFrame) DataFrame [source]¶
Re-order the columns of the dataframe.
First columns are [Country, Year]
- pivot_column: str = None¶
- pivot_values: str = None¶
- property pivot_values_list: list¶
- suffixes: list = None¶
- property suffixes_list: list¶
- class cowidev.grapher.files.Exploriser(location: str = 'location', date: str = 'date', pivot_column: str = None, pivot_values: str = None, function_input: Callable = <function Exploriser.<lambda> at 0x7f90a956af70>, function_output: Callable = <function Exploriser.<lambda> at 0x7f90a94f20d0>)[source]¶
Bases:
object
- date: str = 'date'¶
- function_input()¶
- function_output()¶
- location: str = 'location'¶
- pivot_column: str = None¶
- pivot_values: str = None¶
- class cowidev.grapher.files.Grapheriser(location: str = 'location', date: str = 'date', date_ref: datetime.datetime = datetime.datetime(2020, 1, 21, 0, 0), fillna: bool = False, fillna_0: bool = True, pivot_column: str = None, pivot_values: str = None, suffixes: list = None, function_input: Callable = <function Grapheriser.<lambda> at 0x7f90a955ce50>, function_output: Callable = <function Grapheriser.<lambda> at 0x7f90a955cee0>, columns_non_fillna_0: list = <factory>)[source]¶
Bases:
object
- property columns_metadata: list¶
- columns_non_fillna_0: list¶
- date: str = 'date'¶
- date_ref: datetime = datetime.datetime(2020, 1, 21, 0, 0)¶
- property do_pivot¶
- fillna: bool = False¶
- fillna_0: bool = True¶
- function_input()¶
- function_output()¶
- location: str = 'location'¶
- property metric2suffix: dict¶
- pipe_metadata_columns(df: DataFrame) DataFrame [source]¶
Rename columns and convert date to Year grapher metric.
- pipe_normalize_columns(df)[source]¶
Normalize column names.
If columns are multiindex (of length 2), use first and second positions to create new column name.
This only applies if pivot has been done, i.e. pivot_column and pivot_values are not None.
- pipe_order_columns(df: DataFrame) DataFrame [source]¶
Re-order the columns of the dataframe.
First columns are [Country, Year]
- pivot_column: str = None¶
- pivot_values: str = None¶
- property pivot_values_list: list¶
- suffixes: list = None¶
- property suffixes_list: list¶