module plotting.timeseries

Short summary

module manydataapi.plotting.timeseries

Common plots for timeseries.

source on GitHub

Functions

function

truncated documentation

get_index_date

Returns the only column date. Raises an exception otherwise.

get_new_column

Get a new column which does not exists in df.

plot_aggregated_ts

Plots an aggregated time series by a period of time.

Documentation

Common plots for timeseries.

source on GitHub

manydataapi.plotting.timeseries.get_index_date(df)

Returns the only column date. Raises an exception otherwise.

Parameters:

df – dataframe

Returns:

column name

source on GitHub

manydataapi.plotting.timeseries.get_new_column(df, name)

Get a new column which does not exists in df.

Parameters:

name – suggestion

source on GitHub

manydataapi.plotting.timeseries.plot_aggregated_ts(df, value, date=None, agg='month', ax=None, kind='bar', **kwargs)

Plots an aggregated time series by a period of time.

Parameters:
  • df – dataframe

  • value – column to show

  • date – column to use as a date, if None, it assume there is one and only one

  • agg – aggregation by 'month', 'day', 'year', 'weekday', 'hour', weekhour'

  • kind – graph style

  • ax – existing ax

  • kwargs – additional parameter for the graph

Returns:

ax

import matplotlib.pyplot as plt
from manaydataapi.timeseries import plot_aggregated_ts, daily_timeseries
df = plot_aggregated_ts()
plot_aggregated_ts(df, value='X', agg='month')
plt.show()

source on GitHub