Skip to content

timestamp_stats

timestamp_stats ¤

TimestampStatistics ¤

TimestampStatistics(
    dataframe: DataFrame, column_name: str = "systime"
)

Bases: Base

Provides class methods to calculate statistics on timestamp columns in a pandas DataFrame. The default column for calculations is 'systime'.

count_null classmethod ¤

count_null(
    dataframe: DataFrame, column_name: str = "systime"
) -> int

Returns the number of null (NaN) values in the timestamp column.

count_not_null classmethod ¤

count_not_null(
    dataframe: DataFrame, column_name: str = "systime"
) -> int

Returns the number of non-null (valid) timestamps in the column.

earliest_timestamp classmethod ¤

earliest_timestamp(
    dataframe: DataFrame, column_name: str = "systime"
)

Returns the earliest timestamp in the column.

latest_timestamp classmethod ¤

latest_timestamp(
    dataframe: DataFrame, column_name: str = "systime"
)

Returns the latest timestamp in the column.

timestamp_range classmethod ¤

timestamp_range(
    dataframe: DataFrame, column_name: str = "systime"
)

Returns the time range (difference) between the earliest and latest timestamps.

most_frequent_timestamp classmethod ¤

most_frequent_timestamp(
    dataframe: DataFrame, column_name: str = "systime"
)

Returns the most frequent timestamp in the column.

count_most_frequent_timestamp classmethod ¤

count_most_frequent_timestamp(
    dataframe: DataFrame, column_name: str = "systime"
) -> int

Returns the count of the most frequent timestamp in the column.

year_distribution classmethod ¤

year_distribution(
    dataframe: DataFrame, column_name: str = "systime"
) -> pd.Series

Returns the distribution of timestamps per year.

month_distribution classmethod ¤

month_distribution(
    dataframe: DataFrame, column_name: str = "systime"
) -> pd.Series

Returns the distribution of timestamps per month.

weekday_distribution classmethod ¤

weekday_distribution(
    dataframe: DataFrame, column_name: str = "systime"
) -> pd.Series

Returns the distribution of timestamps per weekday.

hour_distribution classmethod ¤

hour_distribution(
    dataframe: DataFrame, column_name: str = "systime"
) -> pd.Series

Returns the distribution of timestamps per hour of the day.

most_frequent_day classmethod ¤

most_frequent_day(
    dataframe: DataFrame, column_name: str = "systime"
) -> int

Returns the most frequent day of the week (0=Monday, 6=Sunday).

most_frequent_hour classmethod ¤

most_frequent_hour(
    dataframe: DataFrame, column_name: str = "systime"
) -> int

Returns the most frequent hour of the day (0-23).

average_time_gap classmethod ¤

average_time_gap(
    dataframe: DataFrame, column_name: str = "systime"
) -> pd.Timedelta

Returns the average time gap between consecutive timestamps.

median_timestamp classmethod ¤

median_timestamp(
    dataframe: DataFrame, column_name: str = "systime"
)

Returns the median timestamp in the column.

standard_deviation_timestamps classmethod ¤

standard_deviation_timestamps(
    dataframe: DataFrame, column_name: str = "systime"
) -> pd.Timedelta

Returns the standard deviation of the time differences between consecutive timestamps.

timestamp_quartiles classmethod ¤

timestamp_quartiles(
    dataframe: DataFrame, column_name: str = "systime"
) -> pd.Series

Returns the 25th, 50th (median), and 75th percentiles of the timestamps.

days_with_most_activity classmethod ¤

days_with_most_activity(
    dataframe: DataFrame,
    column_name: str = "systime",
    n: int = 3,
) -> pd.Series

Returns the top N days with the most timestamp activity.