ineqpy.utils
Useful functions that make easier develop other functions.
Module Contents
Functions
|
|
|
Generalize main arguments as Series of a pd.Dataframe. |
|
Create weights. |
|
Filter not null condition. |
|
|
|
|
|
Normalize data by the sum. |
|
Extract values. |
Generate data data (not sampled) from weights. |
|
|
Generate sampled data for testing. |
- ineqpy.utils._apply_to_df(func, df, x, weights, *args, **kwargs)[source]
Generalize main arguments as Series of a pd.Dataframe.
- Parameters:
- funcfunction
Function to convert his arguments in Series of an Dataframe.
- dfpandas.Dataframe
DataFrame whats contains the Series x_name and w_name.
- x_namestr
Name of the column in df.
- weights_namestr
Name of the column in df.
- Returns:
- returnfunc return
It’s depends of func output type.
- ineqpy.utils.not_empty_weights(weights, like)[source]
Create weights.
Create normalized weight if it’s None use like to create it.
- Parameters:
- income, likearray-like
- Returns:
- weightsarray-like
Filtered array-like.
See also
- ineqpy.utils.not_null_condition(income, weights)[source]
Filter not null condition.
If a negative value is found in the incomes it will dropped.
- Parameters:
- income, weightsarray-like
- Returns:
- income, weightsarray-like
Filtered array-like.
- ineqpy.utils.normalize(this)[source]
Normalize data by the sum.
- Parameters:
- thisarray-like
- Returns:
- outarray-like
- ineqpy.utils.extract_values(data, variable, weights)[source]
Extract values.
- Parameters:
- datapandas.DataFrame
- variablestr
- weightsstr
- Returns:
- variable, weightsarray-like