源代码为:
class GetData:
def init(self, stock_id, save_path):
self.stock_id = stock_id
self.save_path = save_path
self.data = None
def getData(self):
self.data = ts.get_hist_data(self.stock_id,start='2012-01-04',end='2021-12-31').iloc[::]
self.data = self.data[["open", "close", "high", "low", "volume","ma5","ma20","v_ma5","v_ma10","turnover"]]
self.data.to_csv(self.save_path)
return self.data
def process_data(self, n):
if self.data is None:
self.getData()
return self.data
if name == 'main':
GD = GetData(stock_id='000963', save_path='C:/Users/86188/Desktop/shuju/data2.csv')
GD.getData()
运行以后报错
尝试安装tushare: pip install tushare,但问题没有解决
我的文件里也没有tushare。这该怎么解决