module plotting.timeseries
¶
Short summary¶
module manydataapi.plotting.timeseries
Common plots for timeseries.
Functions¶
function |
truncated documentation |
---|---|
Returns the only column date. Raises an exception otherwise. |
|
Get a new column which does not exists in df. |
|
Plots an aggregated time series by a period of time. |
Documentation¶
Common plots for timeseries.
- manydataapi.plotting.timeseries.get_index_date(df)¶
Returns the only column date. Raises an exception otherwise.
- Parameters:
df – dataframe
- Returns:
column name
- manydataapi.plotting.timeseries.get_new_column(df, name)¶
Get a new column which does not exists in df.
- Parameters:
name – suggestion
- 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()