python创建类统计属性

介绍 (Introduction)

Sometimes you may need a distribution figure for your slide or class. Since you are not using data, you want a quick solution.

有时,您的幻灯片或课程可能需要一个分配图。 由于您不使用数据,因此需要快速解决方案。

A Python package, Statsfig, can create different distribution figures with one line of code.

Python套件Statsfig可以用一行代码创建不同的分布图。

I’d like to show you how easy it is to create each figure.

我想向您展示创建每个图形有多么容易。

安装 (Installation)

Using pip :

使用pip

pip install statsfig

Then import it.

然后导入。

import statsfig as sf

功能清单 (List of Functions)

There are eleven functions you can use. Ten distribution functions and one plot.

您可以使用十一个功能。 十个分布函数和一个图。

演示地址

Function names and descriptions.
函数名称和说明。

伯努利分布 (Bernoulli distribution)

bernofig() (bernofig())

The bernofig() function creates a Bernoulli distribution and the following table shows all the parameters.

bernofig()函数创建一个Bernoulli分布,下表显示了所有参数。

演示地址

bernofig parameters.
bernofig参数。

The default function has a probability of 0.5 and a size of 1000.

默认函数的概率为0.5,大小为1000。

演示地址

fernofig() default function.
fernofig()默认函数。

The following example shows a probability of 0.6, a different color, and without the grid.

以下示例显示了0.6的概率,不同的颜色并且没有网格。

演示地址

bernofig() with different probability, color, and grid.
具有不同概率,颜色和网格的bernofig()。

二项分布 (Binomial Distribution)

binofig() (binofig())

The binofig() function creates a binomial distribution and the following table shows all the parameters.

binofig()函数创建一个二项式分布,下表显示了所有参数。

演示地址

binofig() parameters.
binofig()参数。

The default function has a probability of 0.5 and a size of 1000.

默认函数的概率为0.5,大小为1000。

演示地址

binofig() default function.
binofig()默认函数。

The following example has a probability of 0.7, the number is trials of 30 and shifting 1 to the right.

下面的示例的概率为0.7,次数为30,向右移动1。

演示地址

binofig() example with different arguments.
具有不同参数的binofig()示例。

箱须图 (Box and Whisker Plot)

This is the only one that is not a distribution figure.

这是唯一一个没有分配数字的人。

箱形图() (boxplot())

The boxplot() function creates a box and whisker plot and the following table shows all the parameters.

boxplot()函数创建一个箱须图,下表显示了所有参数。

演示地址

boxplot() parameters.
boxplot()参数。

The default function has the following value for the info argument.

默认函数的info参数具有以下值。

{‘bplot 1’:[-9, -4, 2, 4, 9], ‘bplot 2’:[-5, -2, 1, 3, 8], ‘bplot 3’:[1, 4, 6, 8, 10]}

The info must have a dictionary form with name:[min, lower quartile, median, upper quartile, max].

info必须具有name:[min, lower quartile, median, upper quartile, max]的字典形式。

演示地址

boxplot() default function.
boxplot()默认函数。

If you want to show only one box and whisker plot, you can do this:

如果您只想显示一个方框图和晶须图,则可以执行以下操作:

演示地址

boxplot() example with different arguments.
具有不同参数的boxplot()示例。

Changing vert=False displays the plot horizontally.

更改vert=False会水平显示绘图。

演示地址

boxplot() example with different arguments.
具有不同参数的boxplot()示例。

卡方分布 (Chi-square Distribution)

chifig() (chifig())

The chifig() function creates a Chi-square distribution and the following table shows all the parameters.

chifig()函数创建一个卡方分布,下表显示了所有参数。

演示地址

chifig() parameters.
chifig()参数。

The default function has [1,4,6,7] for the degree of freedom.

默认功能的自由度为[1,4,6,7]。

演示地址

chifig() default function.
chifig()默认函数。

You can change the degrees of freedom by changing the dof argument using a python list as following.

您可以使用以下python列表通过更改dof参数来更改dof

演示地址

chifig() example with different arguments.
chifig()示例具有不同的参数。

指数分布 (Exponential Distribution)

expofig() (expofig())

The expofig() function creates an Exponential distribution and the following table shows all the parameters.

expofig()函数创建指数分布,下表显示了所有参数。

演示地址

expofig() parameters.
expofig()参数。

The default function has a standard deviation of 1 and size of 1000.

默认功能的标准偏差为1,大小为1000。

演示地址

expofig() default function.
expofig()默认函数。

You can hide the histogram by changing the hist argument to False.

您可以通过将hist参数更改为False来隐藏直方图。

演示地址

expofig() example with different arguments.
expofig()示例具有不同的参数。

伽玛分布 (Gamma Distribution)

gammafig() (gammafig())

The gammafig() function creates a Gamma distribution and the following table shows all the parameters.

gammafig()函数创建一个Gamma分布,下表显示了所有参数。

演示地址

gammafig() parameters.
gammafig()参数。

The default function has a shape parameter of 5 and a size of 1000.

默认函数的shape参数为5,大小为1000。

演示地址

gammafig() default function.
gammafig()默认函数。

You can change the color by changing the color argument. You can use one of the characters {'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}, which are short-hands for blue, green, red, cyan, magenta, yellow, black, and white. You can also use a hex RGB or RGBA string (e.g., '#4287f5' or '#4287f580').

您可以通过更改color参数来更改color 。 您可以使用以下字符之一: {'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'} ,它们是蓝色,绿色的简写形式,红色,青色,洋红色,黄色,黑色和白色。 您也可以使用十六进制RGB或RGBA字符串(例如'#4287f5''#4287f580' )。

演示地址

gammafig() example with different arguments.
带不同参数的gammafig()示例。

正态分布 (Normal Distribution)

规范 (normcdf)

The normcdf() function creates a Normal distribution and the following table shows all the parameters.

normcdf()函数创建一个正态分布,下表显示了所有参数。

演示地址

normcdf() parameters.
normcdf()参数。

The default function has a mean of 0 and a standard deviation of 1.

默认函数的平均值为0,标准偏差为1。

演示地址

normcdf() default function.
normcdf()默认函数。

If you wish, you can change most of the arguments as follows:

如果愿意,可以如下更改大多数参数:

演示地址

normcdf() example with different arguments.
具有不同参数的normcdf()示例。

Changing the lb, the lower quartile and the ub, the upper quartile, you can find the probability of between two values.

更改lb (下四分位数)和ub (上四分位数),您可以找到两个值之间的概率。

演示地址

Another example of normcdf() with different arguments.
带有不同参数的normcdf()的另一个示例。

规范pdf_std (normpdf_std)

The normpdf_std() function creates a Normal distribution with different standard deviations. The following table shows all the parameters.

normpdf_std()函数创建具有不同标准偏差的正态分布。 下表显示了所有参数。

演示地址

normpdf_std() parameters.
normpdf_std()参数。

The default function has [1,2,3,4] for the degrees of freedom to display.

默认功能的显示自由度为[1,2,3,4]。

演示地址

normpdf_std() default function.
normpdf_std()默认函数。

You can use a Python list to change the val argument for different degrees of freedom.

您可以使用Python列表更改不同自由度的val参数。

演示地址

normpdf_std() example with different arguments.
具有不同参数的normpdf_std()示例。

normpdf_mean (normpdf_mean)

The normpdf_mean() function creates a Normal distribution with different means. The following table shows all the parameters.

normpdf_mean()函数使用不同的方式创建正态分布。 下表显示了所有参数。

演示地址

normpdf_mean() parameters.
normpdf_mean()参数。

The default function has [0,1,2,3] for the mean values to display.

默认功能的平均值显示为[0,1,2,3]。

演示地址

normpdf_mean() default function.
normpdf_mean()默认函数。

You can change the title, x-axis minimum, and maximum values as follows:

您可以如下更改标题,x轴最小值和最大值:

演示地址

normpdf_mean() example with different arguments.
具有不同参数的normpdf_mean()示例。

泊松分布 (Poisson Distribution)

poisfig() (poisfig())

The poisfig() function creates a Poisson distribution and the following table shows all the parameters.

poisfig()函数创建一个泊松分布,下表显示了所有参数。

演示地址

poisfig() parameters.
poisfig()参数。

The default function has 4 the μ value and a size of 1000.

默认函数的μ值为4,大小为1000。

演示地址

poisfig() default function.
poisfig()默认函数。

演示地址

poisfig() example with different arguments.
poisfig()示例具有不同的参数。

均匀分布 (Uniform Distribution)

uniformfig() (uniformfig())

The uniformfig() function creates a Uniform distribution and the following table shows all the parameters.

uniformfig()函数创建一个Uniform分布,下表显示了所有参数。

演示地址

uniformfig() parameters.
Uniformfig()参数。

The default function has a size of 1000, start at 10 and a width of 20.

默认功能的大小为1000,从10开始,宽度为20。

演示地址

uniformfig() default function.
uniformfig()默认函数。

Here we are changing the color, grid, and figure width and length.

在这里,我们更改颜色,网格以及图形的宽度和长度。

演示地址

uniformfig() example with different arguments.
具有不同参数的Uniformfig()示例。

终奌站 (Terminal)

You can create a figure from your terminal as well.

您也可以从终端创建图形。

Creating a figure from the terminal.
从终端创建图形。

结论 (Conclusion)

I hope you found it is much easier to create figures with the Statsfig package. I’d love to hear any comments about the package. Feel free to leave a message below, or reach out to me through Twitter.

我希望您发现使用Statsfig软件包创建图形要容易得多 。 我希望听到有关该包裹的任何评论。 随时在下面留言,或通过Twitter与我联系。

Please stay tuned for the next post.

请继续关注下一篇文章。

翻译自: https://towardsdatascience.com/a-python-package-to-create-stats-figures-with-ease-503cf6ec0b26

python创建类统计属性


http://www.taodudu.cc/news/show-997558.html

相关文章:

  • knn分类 knn_关于KNN的快速小课程
  • 机器学习集群_机器学习中的多合一集群技术在无监督学习中应该了解
  • 政府公开数据可视化_公开演讲如何帮助您设计更好的数据可视化
  • 消费者行为分析_消费者行为分析-是否点击广告?
  • 魅族mx5游戏模式小熊猫_您不知道的5大熊猫技巧
  • 数据科学中的数据可视化
  • 多重线性回归 多元线性回归_了解多元线性回归
  • 如何使用Python处理丢失的数据
  • 为什么印度盛产码农_印度农产品价格的时间序列分析
  • tukey检测_回到数据分析的未来:Tukey真空度的整洁实现
  • 到2025年将保持不变的热门流行技术
  • 马尔科夫链蒙特卡洛_蒙特卡洛·马可夫链
  • 数据分布策略_有效数据项目的三种策略
  • 密度聚类dbscan_DBSCAN —基于密度的聚类方法的演练
  • 从完整的新手到通过TensorFlow开发人员证书考试
  • 移动平均线ma分析_使用动态移动平均线构建交互式库存量和价格分析图
  • 静态变数和非静态变数_统计资料:了解变数
  • 不知道输入何时停止_知道何时停止
  • 掌握大数据数据分析师吗?_要掌握您的数据吗? 这就是为什么您应该关心元数据的原因...
  • 微信支付商业版 结算周期_了解商业周期
  • mfcc中的fft操作_简化音频数据:FFT,STFT和MFCC
  • r语言怎么以第二列绘制线图_用卫星图像绘制世界海岸线图-第二部分
  • rcp rapido_Rapido使用数据改善乘车调度
  • 飞机上的氧气面罩有什么用_第2部分—另一个面罩检测器……(
  • 数字经济的核心是对大数据_大数据崛起为数字世界的核心润滑剂
  • azure第一个月_MLOps:两个Azure管道的故事
  • 编译原理 数据流方程_数据科学中最可悲的方程式
  • 解决朋友圈压缩_朋友中最有趣的朋友[已解决]
  • pymc3 贝叶斯线性回归_使用PyMC3进行贝叶斯媒体混合建模,带来乐趣和收益
  • ols线性回归_普通最小二乘[OLS]方法使用于机器学习的简单线性回归变得容易

python创建类统计属性_轻松创建统计数据的Python包相关推荐

  1. python作排产计划_轻松打造11周精通python计划(完结) | 软件库

    摘要 Python 语言是计算机工程.大数据及人工智能等领域的基础性语言,广泛且深刻地影响着信息技术各领域的发展方式及速度,从软件开发到硬件开发.从数据科学到智能技术.从应用实践到科技创新,它无处不在 ...

  2. python自定义类的属性_我可以将自定义方法/属性添加到内置Python类型吗?

    For example-say I want to add a helloWorld() method to Python's dict type. Can I do this? JavaScript ...

  3. 怎么用python画心_python怎么画心Python的类实例属性访问规则

    一般来说,在Python中,类实例属性的访问规则算是比较直观的. 但是,仍然存在一些不是很直观的地方,特别是对C++和Java程序员来说,更是如此. 在这里,我们需要明白以下几个地方: 1.Pytho ...

  4. python与网页交互_可爱的 Python: 使用 mechanize 和 Beautiful Soup 轻松收集 Web 数据

    可爱的 Python 使用 mechanize 和 Beautiful Soup 轻松收集 Web 数据 使用 Python 工具简化 Web 站点数据的提取和组织 David Mertz 2010 ...

  5. 可爱的 Python: 使用 mechanize 和 Beautiful Soup 轻松收集 Web 数据

    可爱的 Python: 使用 mechanize 和 Beautiful Soup 轻松收集 Web 数据 使用 Python 工具简化 Web 站点数据的提取和组织 David Mertz, Ph. ...

  6. LVOOP(一)、如何创建类、属性和方法

    如何创建类.属性和方法 LabVIEW类包括数据.属性和方法.其中数据是私有的,只能通过属性或方法来访问. 属性和方法的区别:属性强调的是静态的,而方法强调的是动态的,有很多时候完成的功能相同,具体用 ...

  7. python 多进程 调用模块内函数_进程创建fork()和multiprocessing模块Process类

    一.进程VS程序 一个人穿上军装去打仗就是战士,战士需要武器.战场等资源.一个人去种田就是农民,农民需要土地.锄头等资源. 编写完毕的代码,安静的呆在磁盘上,称之为程序.代码要运行就得加载到内存,正在 ...

  8. python制作ai小说网_【案例分享】使用Python创建AI比你想象的轻松

    您可能对AI领域,主要开发阶段,成就,结果和产品使用感兴趣.有数百个免费源和教程描述使用Python的AI.但是,没有必要浪费你的时间看他们.这里是一个详细的指南,你需要知道在使用Python构建人工 ...

  9. python创建类的实例化_在C中实例化python类#

    IronPython类不是.NET类.它们是IronPython.Runtime.Types.pythotype的实例,后者是Python元类.这是因为Python类是动态的,并且支持在运行时添加和删 ...

最新文章

  1. 搜索算法,一触即达:GitHub上有个规模最大的开源算法库
  2. 远程服务器存储之JDK方式
  3. 将宽度赋给高度_人生应知长度、懂宽度、有高度
  4. python导入同一文件夹下的类_Python模块导入机制与规范
  5. Django视图系统
  6. 关于Assembly.CreateInstance中被启动对象读取配置文件的问题
  7. linux常用关机命令,linux下常用关机命令
  8. SystemTap笔记03 stap的event和handler
  9. 国土档案管理信息系统【档案著录】-地籍类档案著录
  10. 首批企业入驻“一县一店”:多元化方式助力农产外销
  11. 锂电池充电器设计技巧:从太阳能电池获取更大功率
  12. 计算机c语言好学吗?要是想自学应该怎么办?
  13. win10笔记本合盖无法睡眠(风扇依然在转动)(开盖后不是锁屏状态)
  14. JAVA 九大排序算法
  15. Word自动编号,掌握这几招,再也不用手动敲编号!
  16. leetcode:java.T018_4Sum---给定一个整数数组,找出a + b + c + d = target的唯一解,不能有重复元素组
  17. Java SE 第八十八,八十九,九十讲 递归深度剖析 IO流深入详解,递归作业详解
  18. firefox加速技巧
  19. 数据包络分析法(DEA)在数学建模中的应用
  20. 转:黑客讲故事:攻下隔壁女生路由器后,我都做了些什么

热门文章

  1. [洛谷P5048][Ynoi2019模拟赛]Yuno loves sqrt technology III
  2. 201771010102 常惠琢《面向对象程序设计(java)》第八周学习总结
  3. Facade(外观模式)
  4. Bootstrap中水平排列的表单form-inline
  5. RDLC系列之五 初试XAML
  6. 采用HttpModules来重写URLS
  7. C#中打开设计视图时报未将对象引用设置到对象的实例
  8. 符号 RUNOOB python练习题 51
  9. 小程序如何封装自定义组件(Toast)
  10. Python基础:搭建开发环境(1)