Skip to content

Commit

Permalink
Built site for gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mdancho84 committed Nov 6, 2024
1 parent 02dd790 commit 726e187
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .nojekyll
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c72707f2
b739e9a4
114 changes: 76 additions & 38 deletions reference/plot_timeseries.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion search.json
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@
"href": "reference/plot_timeseries.html#examples",
"title": "plot_timeseries",
"section": "Examples",
"text": "Examples\n\nimport pytimetk as tk\n\ndf = tk.load_dataset('m4_monthly', parse_dates = ['date'])\n\n# Plotly Object: Single Time Series\nfig = (\n df\n .query('id == \"M750\"')\n .plot_timeseries(\n 'date', 'value', \n facet_ncol = 1,\n x_axis_date_labels = \"%Y\",\n engine = 'plotly',\n )\n)\nfig\n\n\n \n\n\n\n# Plotly Object: Grouped Time Series (Facets)\nfig = (\n df\n .groupby('id')\n .plot_timeseries(\n 'date', 'value', \n facet_ncol = 2,\n facet_scales = \"free_y\",\n smooth_frac = 0.2,\n smooth_size = 2.0,\n y_intercept = None,\n x_axis_date_labels = \"%Y\",\n engine = 'plotly',\n width = 600,\n height = 500,\n )\n)\nfig\n\n\n \n\n\n\n# Plotly Object: Grouped Time Series (Plotly Dropdown)\nfig = (\n df\n .groupby('id')\n .plot_timeseries(\n 'date', 'value', \n facet_scales = \"free_y\",\n smooth_frac = 0.2,\n smooth_size = 2.0,\n y_intercept = None,\n x_axis_date_labels = \"%Y\",\n engine = 'plotly',\n width = 600,\n height = 500,\n plotly_dropdown = True, # Plotly Dropdown\n )\n)\nfig\n\n\n \n\n\n\n# Plotly Object: Color Column\nfig = (\n df\n .plot_timeseries(\n 'date', 'value', \n color_column = 'id',\n smooth = False,\n y_intercept = 0,\n x_axis_date_labels = \"%Y\",\n engine = 'plotly',\n )\n)\nfig\n\n\n \n\n\n\n# Plotnine Object: Single Time Series\nfig = (\n df\n .query('id == \"M1\"')\n .plot_timeseries(\n 'date', 'value', \n x_axis_date_labels = \"%Y\",\n engine = 'plotnine'\n )\n)\nfig\n\n\n\n\n<Figure Size: (700 x 500)>\n\n\n\n# Plotnine Object: Grouped Time Series\nfig = (\n df\n .groupby('id')\n .plot_timeseries(\n 'date', 'value',\n facet_ncol = 2,\n facet_scales = \"free\",\n line_size = 0.35,\n x_axis_date_labels = \"%Y\",\n engine = 'plotnine'\n )\n)\nfig\n\n\n\n\n<Figure Size: (700 x 500)>\n\n\n\n# Plotnine Object: Color Column\nfig = (\n df\n .plot_timeseries(\n 'date', 'value', \n color_column = 'id',\n smooth = False,\n y_intercept = 0,\n x_axis_date_labels = \"%Y\",\n engine = 'plotnine',\n )\n)\nfig\n\n\n\n\n<Figure Size: (700 x 500)>\n\n\n\n# Matplotlib object (same as plotnine, but converted to matplotlib object)\nfig = (\n df\n .groupby('id')\n .plot_timeseries(\n 'date', 'value', \n color_column = 'id',\n facet_ncol = 2,\n x_axis_date_labels = \"%Y\",\n engine = 'matplotlib',\n )\n)\nfig"
"text": "Examples\n\nimport pytimetk as tk\n\ndf = tk.load_dataset('m4_monthly', parse_dates = ['date'])\n\n# Plotly Object: Single Time Series\nfig = (\n df\n .query('id == \"M750\"')\n .plot_timeseries(\n 'date', 'value', \n facet_ncol = 1,\n x_axis_date_labels = \"%Y\",\n engine = 'plotly',\n )\n)\nfig\n\n\n \n\n\n\n# Plotly Object: Grouped Time Series (Facets)\nfig = (\n df\n .groupby('id')\n .plot_timeseries(\n 'date', 'value', \n facet_ncol = 2,\n facet_scales = \"free_y\",\n smooth_frac = 0.2,\n smooth_size = 2.0,\n y_intercept = None,\n x_axis_date_labels = \"%Y\",\n engine = 'plotly',\n width = 600,\n height = 500,\n )\n)\nfig\n\n\n \n\n\n\n# Plotly Object: Grouped Time Series (Plotly Dropdown)\nfig = (\n df\n .groupby('id')\n .plot_timeseries(\n 'date', 'value', \n facet_scales = \"free_y\",\n smooth_frac = 0.2,\n smooth_size = 2.0,\n y_intercept = None,\n x_axis_date_labels = \"%Y\",\n engine = 'plotly',\n width = 600,\n height = 500,\n plotly_dropdown = True, # Plotly Dropdown\n )\n)\nfig\n\n\n \n\n\n\n# Plotly Object: Color Column\nfig = (\n df\n .plot_timeseries(\n 'date', 'value', \n color_column = 'id',\n smooth = False,\n y_intercept = 0,\n x_axis_date_labels = \"%Y\",\n engine = 'plotly',\n )\n)\nfig\n\n\n \n\n\n\n# Plotnine Object: Single Time Series\nfig = (\n df\n .query('id == \"M1\"')\n .plot_timeseries(\n 'date', 'value', \n x_axis_date_labels = \"%Y\",\n engine = 'plotnine'\n )\n)\nfig\n\n\n\n\n<Figure Size: (700 x 500)>\n\n\n\n# Plotnine Object: Grouped Time Series\nfig = (\n df\n .groupby('id')\n .plot_timeseries(\n 'date', 'value',\n facet_ncol = 2,\n facet_scales = \"free\",\n line_size = 0.35,\n x_axis_date_labels = \"%Y\",\n engine = 'plotnine'\n )\n)\nfig\n\n\n\n\n<Figure Size: (700 x 500)>\n\n\n\n# Plotnine Object: Color Column\nfig = (\n df\n .plot_timeseries(\n 'date', 'value', \n color_column = 'id',\n smooth = False,\n y_intercept = 0,\n x_axis_date_labels = \"%Y\",\n engine = 'plotnine',\n )\n)\nfig\n\n\n\n\n<Figure Size: (700 x 500)>\n\n\n\n# Matplotlib object (same as plotnine, but converted to matplotlib object)\nfig = (\n df\n .groupby('id')\n .plot_timeseries(\n 'date', 'value', \n color_column = 'id',\n facet_ncol = 2,\n x_axis_date_labels = \"%Y\",\n engine = 'matplotlib',\n )\n)\nfig\n\n\n\n\n\n# Wide-Format Plotting\n\n# Imports\nimport pandas as pd\nimport numpy as np\nimport pytimetk as tk\n\n# Set a random seed for reproducibility\nnp.random.seed(42) \n\n# Create a date range\ndates = pd.date_range(start=\"2020-01-01\", periods=100, freq=\"D\")\n\n# Generate random sales data and compute expenses and profit\nsales = np.random.uniform(1000, 5000, len(dates))\nexpenses = sales * np.random.uniform(0.5, 0.8, len(dates))\nprofit = sales - expenses\n\n# Create the DataFrame\ndf = pd.DataFrame({\n 'date': dates,\n 'sales': sales,\n 'expenses': expenses,\n 'profit': profit\n})\n\n(\n df\n .plot_timeseries(\n date_column = 'date', \n value_column = ['sales', 'expenses', 'profit'],\n color_column = ['sales', 'expenses', 'profit'], \n smooth = True,\n x_axis_date_labels = \"%Y\",\n engine = 'plotly',\n plotly_dropdown = True, # Plotly Dropdown\n )\n)"
},
{
"objectID": "reference/augment_diffs.html",
Expand Down
Loading

0 comments on commit 726e187

Please sign in to comment.