microsoft / vivainsights-py

Python package for Analyzing and Visualizing data from Viva Insights
https://microsoft.github.io/vivainsights-py/
Other
13 stars 2 forks source link

Add stats outputs to internal functions #24

Closed martinctc closed 8 months ago

martinctc commented 8 months ago

Summary

This branch adds additional summary stats (e.g. stdev, median, max, min) as an optional output to internal functions, including create_bar_calc() and create_rank_calc()

Changes

The changes made in this PR are:

  1. By setting stats = True, the two functions of create_rank_calc() and create_bar_calc() can expose stdev, median, max, and min figures.
  2. Version incremented to v0.2.4.
  3. Tests modified to accommodate new examples.

Examples

import vivainsights as vi
pq_data = vi.load_pq_data()
vi.create_bar_calc(data = pq_data, metric = 'Collaboration_hours', hrvar = 'Organization', stats = True)
vi.create_rank_calc(
            data=pq_data,
            metric="Emails_sent",
            hrvar=['Organization', 'FunctionType', 'LevelDesignation', 'SupervisorIndicator'],
            mingroup=5,
            stats=True
            )

Checks

Notes

This fixes #

<other things, such as how to incorporate new changes>

martinctc commented 8 months ago

Checks have all passed and now v0.2.4 is on PyPI: https://pypi.org/project/vivainsights/0.2.4/