Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
预测Python中的股票买入或持有_Python_Pandas_Numpy_Prediction - Fatal编程技术网

预测Python中的股票买入或持有

预测Python中的股票买入或持有,python,pandas,numpy,prediction,Python,Pandas,Numpy,Prediction,我目前正在使用随机森林回归器预测股票价格,并根据预测结果决定是否购买或持有股票。我的代码不是结果“买入”或“持有”,而是结果为真或假。 如何解决此问题? 熊猫的数据框架正确使用了整个语法,我尝试了一段类似的代码,效果很好。 也许可以尝试使用,打印(结果['Buy_Hold?') 还要确保在列名中添加“?” 注:你无法为股市创建完美的算法,这也取决于投资者的情绪:)删除“买入持有”中的“?”

我目前正在使用随机森林回归器预测股票价格,并根据预测结果决定是否购买或持有股票。我的代码不是结果“买入”或“持有”,而是结果为真或假。 如何解决此问题?

熊猫的数据框架正确使用了整个语法,我尝试了一段类似的代码,效果很好。 也许可以尝试使用,打印(结果['Buy_Hold?')

还要确保在列名中添加“?”


注:你无法为股市创建完美的算法,这也取决于投资者的情绪:)

删除“买入持有”中的“?”