x = np.linspace(1,10,25)

y = (x-4)**2
index = random.sample(range(25),5) # 从1-24中不放回随机抽取5个数
y[index ] = [np.nan]*5


plt.plot(x,y,'o-') # 一定要保证x,y等长
plt.show()

plt.plot(x,(x-4)**2,'x',x,y,'o-')
plt.show()

plot 含缺失值的图

plot 含缺失值的图

 

相关文章:

  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2021-10-03
  • 2021-11-30
  • 2022-12-23
猜你喜欢
  • 2021-11-02
  • 2022-01-15
  • 2021-10-28
相关资源
相似解决方案