is_pd_object
pd.DataFrame or pd.Series.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
obj | object | -- | The object to check. |
to_frame | bool | False | If True and the object is a pd.Series, convert it to a pd.DataFrame. |
| Type | Description |
|---|---|
ValueError | If the object is neither a pd.DataFrame nor a pd.Series. |
| Type | Description |
|---|---|
pd.DataFrame or None | The pd.DataFrame or pd.Series. |
is_pd_dataframe
pd.DataFrame.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
obj | object | -- | The object to check. |
| Type | Description |
|---|---|
ValueError | If the object is not a pd.DataFrame. |
is_valid_shape
| Name | Type | Default | Description |
|---|---|---|---|
a | pd.DataFrame | -- | The first DataFrame. |
b | pd.DataFrame | -- | The second DataFrame. |
| Type | Description |
|---|---|
ValueError | If the shapes are not compatible. |
| Type | Description |
|---|---|
pd.DataFrame | The aligned second pd.DataFrame. |
is_valid_squarred_shape
| Name | Type | Default | Description |
|---|---|---|---|
cov | pd.DataFrame | -- | The covariance matrix. |
weights | tp.SeriesFrame | -- | The weights vector. |
| Type | Description |
|---|---|
ValueError | If the covariance matrix is not square or not aligned with weights. |
is_fitted
| Name | Type | Default | Description |
|---|---|---|---|
attr_name | str | -- | The name of the attribute to check. |
raise_error | bool | True | If True, raise an error if the object is not fitted. |
custom_func | callable | None | A custom function to call if the object is not fitted. |
custom_func_kwargs | tp.Kwargs | -- | Additional arguments for the custom function. |
| Type | Description |
|---|---|
NotFittedError | If the object is not fitted and raise_error is True. |
| Type | Description |
|---|---|
tp.Callable | The decorated method. |
is_freq_valid
pd.Index is valid.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
index | pd.Index | -- | The index to check. |
freq | str | -- | The target frequency. |
| Type | Description |
|---|---|
ValueError | If the frequency cannot be parsed. |
| Type | Description |
|---|---|
bool | True if the frequency is valid, False otherwise. |
is_int
int (excluding timedelta).
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
arg | tp.Any | -- | The argument to check. |
| Type | Description |
|---|---|
bool | True if the argument is an integer, False otherwise. |
is_float
float.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
arg | tp.Any | -- | The argument to check. |
| Type | Description |
|---|---|
bool | True if the argument is a float, False otherwise. |
is_number
| Name | Type | Default | Description |
|---|---|---|---|
arg | tp.Any | -- | The argument to check. |
| Type | Description |
|---|---|
bool | True if the argument is a number, False otherwise. |

