Python 我怎样才能摆脱这个警告?(运行时警告:在双_标量中遇到无效值) 解决了

Python 我怎样才能摆脱这个警告?(运行时警告:在双_标量中遇到无效值) 解决了,python,pandas,Python,Pandas,已使用n=np.除法(number1,number2) 如果数字2>0,则在除法前选中 我有以下代码: condition5 = round(((df['Close'][-1] - df['Low'][-1])/(df['High'][-1] - df['Low'][-1])),2) < 0.25 我得到的信息是: RuntimeWarning: invalid value encountered in double_scalars condition5 = round(((df[

已使用
n=np.除法(number1,number2)

如果数字2>0,则在除法前选中


我有以下代码:

condition5 = round(((df['Close'][-1] - df['Low'][-1])/(df['High'][-1] - df['Low'][-1])),2) < 0.25
我得到的信息是:

RuntimeWarning: invalid value encountered in double_scalars
  condition5 = round(((df['Close'][-1] - df['Low'][-1])/(df['High'][-1] - df['Low'][-1])),2) < 0.25
打印(df.to_dict())

打印(df.info())


日期时间索引:3个条目,2019-11-22至2019-11-26
数据列(共6列):
高3非空浮点64
低3非空浮点64
打开3个非空浮点64
关闭3个非空浮点64
第3卷非空int64
Adj Close 3非空浮点64
数据类型:float64(5)、int64(1)
内存使用:168.0字节
没有一个

请检查以下内容的输出:
df['High'][-1]-df['Low'][-1]
并报告此数据帧中的最小值和最大值。
日期是否为
索引?您是否介意共享
print(df.to_dict())
?您是否介意发布
df.info()的输出?
?在更新部分共享所有这些打印
RuntimeWarning: invalid value encountered in double_scalars
  condition5 = round(((df['Close'][-1] - df['Low'][-1])/(df['High'][-1] - df['Low'][-1])),2) < 0.25
4.660003662109375
{'High': {Timestamp('2019-11-22 00:00:00'): 263.17999267578125, Timestamp('2019-11-25 00:00:00'): 266.44000244140625, Timestamp('2019-11-26 00:00:00'): 267.1600036621094}, 'Low': {Timestamp('2019-11-22 00:00:00'): 260.
8399963378906, Timestamp('2019-11-25 00:00:00'): 262.5199890136719, Timestamp('2019-11-26 00:00:00'): 262.5}, 'Open': {Timestamp('2019-11-22 00:00:00'): 262.5899963378906, Timestamp('2019-11-25 00:00:00'): 262.70999145
50781, Timestamp('2019-11-26 00:00:00'): 266.94000244140625}, 'Close': {Timestamp('2019-11-22 00:00:00'): 261.7799987792969, Timestamp('2019-11-25 00:00:00'): 266.3699951171875, Timestamp('2019-11-26 00:00:00'): 264.29
00085449219}, 'Volume': {Timestamp('2019-11-22 00:00:00'): 16331300, Timestamp('2019-11-25 00:00:00'): 21005100, Timestamp('2019-11-26 00:00:00'): 26301900}, 'Adj Close': {Timestamp('2019-11-22 00:00:00'): 261.77999877
92969, Timestamp('2019-11-25 00:00:00'): 266.3699951171875, Timestamp('2019-11-26 00:00:00'): 264.2900085449219}}
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 3 entries, 2019-11-22 to 2019-11-26
Data columns (total 6 columns):
High         3 non-null float64
Low          3 non-null float64
Open         3 non-null float64
Close        3 non-null float64
Volume       3 non-null int64
Adj Close    3 non-null float64
dtypes: float64(5), int64(1)
memory usage: 168.0 bytes
None