Skip to content

Pandas

This module contains the following categories:

category import Applications
utils from random_functions.pandas import utils Contain helper functions that solves commonly occuring simple tasks while using pandas

utils

create_dummy_dataframe(time_column, columns, n_rows)

Creates a dummy dataframe with the provided list of column names. Includes a datetime column time_column is set to True.

Usage:

from random_functions.pandas.utils import create_dummy_dataframe

create_dummy_dataframe(
    time_column=True,
    columns=['col_1', 'col_2', 'col_3'],
    n_rows=100
)

Parameters:

Name Type Description Default
time_column bool

Includes a datetime column if set to True

required
columns list

List of column names to be included in the dummy dataframe returned

required
n_rows int

Number of rows required for the dummy dataframe

required

Returns:

Type Description
DataFrame

The created dummy dataframe