How to plot and work with NaN values in matplotlib

前端 未结 2 1147
夕颜
夕颜 2020-12-08 07:44

I have hourly data consisting of a number of columns. First column is a date (date_log), and the rest of columns contain different sample points. The trouble is

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 08:06

    I simply use this function:

    import math
    for i in range(1,len(data)):
      if math.isnan(data[i]):
        data[i] = data[i-1]
    

提交回复
热议问题