# (38)Python二项分布

``````from scipy.stats import binom
import seaborn as sb

binom.rvs(size=10,n=20,p=0.8)

data_binom = binom.rvs(n=20,p=0.8,loc=0,size=1000)
ax = sb.distplot(data_binom,
kde=True,
color='blue',
hist_kws={"linewidth": 25,'alpha':1})
ax.set(xlabel='Binomial', ylabel='Frequency')
```Python``` 关注右侧公众号，随时随地查看教程
Python数据分析教程目录
{"ft_lang_label":"__label__zh","ft_lang_prob":0.7374376,"math_prob":0.97737384,"size":484,"snap":"2022-05-2022-21","text_gpt3_token_len":279,"char_repetition_ratio":0.09791667,"word_repetition_ratio":0.0,"special_character_ratio":0.25826445,"punctuation_ratio":0.22352941,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9994665,"pos_list":[0,1,2],"im_url_duplicate_count":[null,2,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-18T06:38:53Z\",\"WARC-Record-ID\":\"<urn:uuid:b592cdfe-c483-45a5-9ec4-88ac9e75f7a0>\",\"Content-Length\":\"138130\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b3794404-b816-409e-bed1-82ea6a09acc7>\",\"WARC-Concurrent-To\":\"<urn:uuid:f2545ef5-001e-49b7-b81f-6144570efef0>\",\"WARC-IP-Address\":\"101.201.69.18\",\"WARC-Target-URI\":\"https://www.giserdqy.com/backend/py/python_data_science/11319/\",\"WARC-Payload-Digest\":\"sha1:EY2HTP2G23JMPQJIH2HIEZSJNZNBQX2A\",\"WARC-Block-Digest\":\"sha1:PYSQJGICRMZHVBTSZGZXBQWJ6GIEC4RC\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662521152.22_warc_CC-MAIN-20220518052503-20220518082503-00213.warc.gz\"}"}