def get_stock_basics(cls): #上市公司基本情况 data = ts.get_stock_basics() data['code'] = data.index data.reset_index(drop=True, inplace=True) ModelData.remove_data(table_name='stock_basics') print('remove success') ModelData.insert_data(table_name='stock_basics', data=data) print('write success')
def get_cashflow_data(cls, year, quarter): data = ts.get_cashflow_data(year, quarter) data['year'] = year data['quarter'] = quarter data.reset_index(drop=True, inplace=True) ModelData.remove_data(table_name='cashflow_data', year=year, quarter=quarter) print('remove success') ModelData.insert_data(table_name='cashflow_data', data=data) print('write success')
def get_profit_data(cls, year, quarter): #反应盈利能力的 data = ts.get_profit_data(year, quarter) data['year'] = year data['quarter'] = quarter data.reset_index(drop=True, inplace=True) ModelData.remove_data(table_name='profit_data', year=year, quarter=quarter) print('remove success') ModelData.insert_data(table_name='profit_data', data=data) print('write success') print(data.head(5))