U形图的自动控制图计算和绘图。
uprime的Python项目详细描述
上时
一个python实现u'-图。
u'-图是属性数据的控制图,它可以通过抵消过度分散来处理大样本和可变样本量,如以下文章所述:david b.laney(2002)改进的属性控制图,质量工程,14:4531-537,doi:10.1081/qen-120003555。
u'-图用于评估一段时间内的属性统计,以确定统计中的变化是否可以仅由随机变化来解释。
此模块包括可自定义的选项,有助于将其用作警报系统。
作者:罗伯特·阿斯特尔
tl;dr:u'-prime控制图规则的实现,该规则可用于创建有关具有高/可变样本大小的统计信息的警报。
开始
安装
pip install uprime
使用量
fromuprimeimportUprime# Four required arguments:# 1. Pandas Dataframe# 2. Name of the column by which the data can be chronologically sorted# 3. Name of the column that contains the number of occurrences of the attribute of interest# The number of occurrences should always be an integer. Non-integer values will be rounded.# 4. Name of the column that contains the size of the subgroup (A.K.A. sample)# The subgroup size should always be an integer. Non-integer values will be rounded.up=Uprime(df,'sort_column_name','occurrences_column_name','subgroup_size_column_name')# Perform u'-chart calculations# Return a Pandas DataFrame that contains all necessary data to plot a u'-chart or trigger alerts up_df=up.frame()
示例
method = rolling, periods = 30
此配置对每个子组使用前30个滚动周期执行U形图计算。
这不同于默认的method = 'all'
,它使用dataframe df中的所有子组来执行计算。
up=Uprime(df,'sort_column_name','occurrences_column_name','subgroup_size_column_name',method='rolling',periods=30)
更多examples,包括使用其他可选参数和内置图表函数。
贡献
阅读我们的CONTRIBUTING.md了解我们的开发过程。
许可证
uptime是根据Apache License 2.0