hello_world
Test file.
do_a_dataframe_thing(df, arr=None)
⚓︎
An example of documentation with references to external libraries.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
DataFrame
|
Input dataframe. |
required |
arr |
ndarray | None
|
Input array. |
None
|
See Also
An explicit reference to a dataframe: pandas.DataFrame for an explicit reference. Or a numpy array: numpy.array.
Returns:
Type | Description |
---|---|
DataFrame
|
A dataframe with some magical operation applied to it. |
Source code in my_project/hello_world.py
def do_a_dataframe_thing(df: pd.DataFrame, arr: np.ndarray | None = None) -> pd.DataFrame:
"""An example of documentation with references to external libraries.
Args:
df: Input dataframe.
arr: Input array.
See Also:
An explicit reference to a dataframe: [pandas.DataFrame][] for an explicit reference.
Or a numpy array: [numpy.array][].
Returns:
A dataframe with some magical operation applied to it.
"""
if arr is not None and arr.size > 0:
return df[arr]
return df