简体   繁体   中英

How to use decimals in seaborn.distplot()?

In my code, I am trying to learn distributions of data. My data is as follows:

18.86
19.86
18.98
18.31
18.76
17.78
17.05
16.75
...

Is there a way to plot these values as distplot() only accepts slices and ints?

CODE:

import seaborn as sns

x = [18.86,19.86,18.98,18.31,18.76,17.78,17.05,16.75]
ax = sns.distplot(x)

在此处输入图像描述

Distplot accepts Parameters a Series, 1d-array, or list.

https://seaborn.pydata.org/generated/seaborn.distplot.html for more detail.

Always follow official documents.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM