python画熊猫代码_用python绘制pandas系列的CDF

我相信您要寻找的功能是在一个Series对象的hist方法中,该方法将hist()函数包装在matplotlib中

这是相关文件In [10]: import matplotlib.pyplot as plt

In [11]: plt.hist?

...

Plot a histogram.

Compute and draw the histogram of *x*. The return value is a

tuple (*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*,

[*patches0*, *patches1*,...]) if the input contains multiple

data.

...

cumulative : boolean, optional, default : True

If `True`, then a histogram is computed where each bin gives the

counts in that bin plus all bins for smaller values. The last bin

gives the total number of datapoints. If `normed` is also `True`

then the histogram is normalized such that the last bin equals 1.

If `cumulative` evaluates to less than 0 (e.g., -1), the direction

of accumulation is reversed. In this case, if `normed` is also

`True`, then the histogram is normalized such that the first bin

equals 1.

...

例如In [12]: import pandas as pd

In [13]: import numpy as np

In [14]: ser = pd.Series(np.random.normal(size=1000))

In [15]: ser.hist(cumulative=True, density=1, bins=100)

Out[15]:

In [16]: plt.show()

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值