{ "cells": [ { "cell_type": "markdown", "metadata": { "pycharm": { "name": "#%% md \n" } }, "source": [ "## Examples - plot_hists(), plot_boxes()" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "pycharm": { "is_executing": false } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(1342, 5)\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
col0col1col2col3dim1
time
2019-01-01 01:39:00-0.104941-0.043834-0.0036450.158883B
2019-01-01 01:40:00-0.109494-0.0322170.0157350.162104A
2019-01-01 01:41:00-0.090573-0.0299160.0114370.168006B
2019-01-01 01:42:00-0.122065-0.0039020.0327570.160433A
2019-01-01 01:43:00-0.1072430.0082040.0331650.170859B
\n", "
" ], "text/plain": [ " col0 col1 col2 col3 dim1\n", "time \n", "2019-01-01 01:39:00 -0.104941 -0.043834 -0.003645 0.158883 B\n", "2019-01-01 01:40:00 -0.109494 -0.032217 0.015735 0.162104 A\n", "2019-01-01 01:41:00 -0.090573 -0.029916 0.011437 0.168006 B\n", "2019-01-01 01:42:00 -0.122065 -0.003902 0.032757 0.160433 A\n", "2019-01-01 01:43:00 -0.107243 0.008204 0.033165 0.170859 B" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "from am4894pd.utils import df_dummy_ts # used to generate some dummy data\n", "from am4894plots.plots import plot_hists, plot_boxes\n", "\n", "# generate some dummy time series data\n", "df = df_dummy_ts(n_cols=4, freq='1min')\n", "df['dim1'] = np.random.choice(['A','B'],len(df))\n", "print(df.shape)\n", "display(df.head())" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "pycharm": { "name": "#%%\n" }, "scrolled": false }, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plot_hists(df, n_cols=2, renderer='notebook', h=600, w=600, cumulative=True)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plot_hists(df, dim='dim1', n_cols=2, renderer='notebook', h=800, w=800, cumulative=True)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", " \n", " \n", "
\n", " \n", "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plot_boxes(df, renderer='notebook', n_cols=4, h=400, w=500)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.1" }, "pycharm": { "stem_cell": { "cell_type": "raw", "metadata": { "collapsed": false }, "source": [] } } }, "nbformat": 4, "nbformat_minor": 1 }