Skip to content

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

hello_world() ⚓︎

Returns "Hello World!" when called.

Returns:

Name Type Description
str str

The string 'Hello world!'.

Example
>>> hello_world()
'Hello World!'
Note

This is an example of a note.

Warning

This is an example of a warning.

Source code in my_project/hello_world.py
def hello_world() -> str:
    """Returns "Hello World!" when called.

    Returns:
        str: The string 'Hello world!'.

    Example:
        ```python
        >>> hello_world()
        'Hello World!'
        ```

    Note:
        This is an example of a note.

    Warning:
        This is an example of a warning.

    """
    return "Hello World!"