# mis_analytics


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

This file will become your README and also the index of your
documentation.

## Developer Guide

If you are new to using `nbdev` here are some useful pointers to get you
started.

### Install mis_core in Development mode

``` sh
# make sure mis_core package is installed in development mode
$ pip install -e .

# make changes under nbs/ directory
# ...

# compile to have changes apply to mis_core
$ nbdev_prepare
```

## Usage

``` python
df = get_demo_data()
df
```

<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }
&#10;    .dataframe tbody tr th {
        vertical-align: top;
    }
&#10;    .dataframe thead th {
        text-align: right;
    }
</style>

<table class="dataframe" data-quarto-postprocess="true" data-border="1">
<thead>
<tr style="text-align: right;">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">order_id</th>
<th data-quarto-table-cell-role="th">product</th>
<th data-quarto-table-cell-role="th">quantity</th>
<th data-quarto-table-cell-role="th">defects</th>
<th data-quarto-table-cell-role="th">production_time</th>
</tr>
</thead>
<tbody>
<tr>
<td data-quarto-table-cell-role="th">0</td>
<td>101</td>
<td>Widget A</td>
<td>50</td>
<td>2</td>
<td>120</td>
</tr>
<tr>
<td data-quarto-table-cell-role="th">1</td>
<td>102</td>
<td>Widget B</td>
<td>30</td>
<td>1</td>
<td>95</td>
</tr>
<tr>
<td data-quarto-table-cell-role="th">2</td>
<td>103</td>
<td>Widget A</td>
<td>75</td>
<td>3</td>
<td>150</td>
</tr>
<tr>
<td data-quarto-table-cell-role="th">3</td>
<td>104</td>
<td>Widget C</td>
<td>20</td>
<td>0</td>
<td>80</td>
</tr>
<tr>
<td data-quarto-table-cell-role="th">4</td>
<td>105</td>
<td>Widget B</td>
<td>45</td>
<td>2</td>
<td>110</td>
</tr>
</tbody>
</table>

</div>

``` python
@track
def aggregate_by_product(df):
    return df.groupby(["product"])[["quantity", "defects", "production_time"]].sum()
```

``` python
@track
def filter_products(df):
    return df[df["product"] != "Widget C"]
```

``` python
steps = [
    (filter_products, {'vrbs':True}),
    (aggregate_by_product, {}),
]
```

``` python
_df = pipeline(df, steps, vrbs_default=False)
```

    *************** filter_products ***************
    Total Time: 1.75 ms

    Start: 2025-12-18 16:05:55.759474
      End: 2025-12-18 16:05:55.761225

    Input DataFrame:
      order_id   product quantity defects production_time
    0      101  Widget A       50       2             120
    1      102  Widget B       30       1              95
    2      103  Widget A       75       3             150
             :         :        :       :               :
    3      104  Widget C       20       0              80
    1      102  Widget B       30       1              95
    4      105  Widget B       45       2             110
    0      101  Widget A       50       2             120
    2      103  Widget A       75       3             150
             :         :        :       :               :
    2      103  Widget A       75       3             150
    3      104  Widget C       20       0              80
    4      105  Widget B       45       2             110

            Input:   5 rows, 5 cols
                         ↓       ↓
            Diff:   -1 rows, 0 cols
                         ↓       ↓
            Output:  4 rows, 5 cols
            
    Output DataFrame:
      order_id   product quantity defects production_time
    0      101  Widget A       50       2             120
    1      102  Widget B       30       1              95
    2      103  Widget A       75       3             150
             :         :        :       :               :
    4      105  Widget B       45       2             110
    0      101  Widget A       50       2             120
    2      103  Widget A       75       3             150
    1      102  Widget B       30       1              95
             :         :        :       :               :
    1      102  Widget B       30       1              95
    2      103  Widget A       75       3             150
    4      105  Widget B       45       2             110

### Installation

Install latest from the GitHub
[repository](https://github.com/MIS-Analytics/mis_analytics):

``` sh
$ pip install git+https://github.com/MIS-Analytics/mis_analytics.git
```

or from [pypi](https://pypi.org/project/mis_analytics/)

``` sh
$ pip install mis_analytics
```

### Documentation

Documentation can be found hosted on this GitHub
[repository](https://github.com/MIS-Analytics/mis_analytics)’s
[pages](https://MIS-Analytics.github.io/mis_analytics/). Additionally
you can find package manager specific guidelines on
[pypi](https://pypi.org/project/mis_analytics/).

## How to use

Fill me in please! Don’t forget code examples:

``` python
1+1
```

    2
