C:\Program Files\Anaconda2\lib\site-packages\astropy\visualization\hist.pyc in hist(x, bins, ax, **kwargs)
54 arglist = list(signature(np.histogram).parameters.keys())[1:]
55 np_hist_kwds = dict((key, kwargs[key]) for key in arglist if key in kwargs)
---> 56 hist, bins = histogram(x, bins, **np_hist_kwds)
57
58 if ax is None:
C:\Program Files\Anaconda2\lib\site-packages\astropy\stats\histogram.pyc in histogram(a, bins, range, weights, **kwargs)
82 bins = bayesian_blocks(a)
83 elif bins == 'knuth':
---> 84 da, bins = knuth_bin_width(a, True) 85 elif bins ==
Python Error1: ValueError: range parameter must be finite.
最新推荐文章于 2023-12-18 22:12:04 发布
在使用astropy库的hist()或histogram()函数时遇到ValueError: range parameter must be finite. 错误通常是由于数据中包含NaN值。解决方法是将NaN值替换为其他数值类型,如使用fillna()函数。
摘要由CSDN通过智能技术生成