简体   繁体   中英

How to plot normal distribution curve for uni variate data using python

How to plot normal distribution curve for univariate data using python. in the below data 493,494,495..... values are just index values. I saw how to plot normal distribution using random values with a mean of 0. Need to know how to plot the curve with univariate data.

Sample dataset is given below:

{'RPM': {493: 7.2,
  494: 7.2,
  495: 7.2,
  496: 7.2,
  567: 8.4,
  568: 8.4,
  569: 8.4,
  570: 8.4,
  767: 18.0,
  768: 18.0,
  781: 23.4,
  782: 23.4,
  783: 23.4,
  784: 23.4,
  785: 23.4,
  806: 23.4,
  807: 23.4,
  808: 23.4,
  809: 23.4,
  810: 23.4,
  811: 23.4,
  812: 23.4,
  951: 23.4,
  952: 23.4,
  953: 23.4,
  954: 11.4,
  955: 11.4,
  957: 11.4,
  981: 19.2,
  982: 23.4,
  983: 23.4,
  984: 23.4,
  1062: 23.4,
  1063: 23.4,
  1064: 23.4,
  1065: 23.4,
  1066: 23.4,
  1068: 23.4,
  1069: 23.4,
  1070: 23.4,
  1071: 23.4,
  1072: 23.4,
  1073: 23.4,
  1074: 23.4,
  1075: 23.4,
  1076: 23.4,
  1077: 23.4,
  1079: 23.4,
  1119: 23.4,
  1120: 23.4,
  1121: 23.4,
  1122: 23.4,
  1123: 23.4,
  1125: 23.4,
  1126: 23.4,
  1127: 23.4,
  1128: 23.4,
  1129: 23.4,
  1130: 23.4,
  1132: 23.4,
  1133: 23.4,
  1134: 23.4,
  1135: 23.4,
  1136: 23.4,
  1137: 23.4,
  1159: 23.4,
  1162: 23.4,
  1164: 23.4,
  1165: 23.4,
  1166: 23.4,
  1167: 23.4,
  1168: 23.4,
  1169: 23.4,
  1171: 23.4,
  1172: 23.4,
  1173: 23.4,
  1174: 23.4

}}

IIUC:

import matplotlib.pyplot as plt
df = pd.Series(data['RPM'].keys())
kde = df.plot.kde()
plt.show()

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