Skip to content

MIS-Analytics/mis_analytics

Repository files navigation

mis_analytics

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

# 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

df = get_demo_data()
df
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } </style>
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
4 105 Widget B 45 2 110
@track
def aggregate_by_product(df):
    return df.groupby(["product"])[["quantity", "defects", "production_time"]].sum()
@track
def filter_products(df):
    return df[df["product"] != "Widget C"]
steps = [
    (filter_products, {'vrbs':True}),
    (aggregate_by_product, {}),
]
_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:

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

or from pypi

$ pip install mis_analytics

Documentation

Documentation can be found hosted on this GitHub repository’s pages. Additionally you can find package manager specific guidelines on pypi.

How to use

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

1+1
2

About

Helpers for data work in supply chain analytics (and others?)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors