mirror of
https://github.com/1nchaos/adata.git
synced 2024-11-25 16:32:39 +08:00
fixed
get_market -- bug
This commit is contained in:
parent
0318285abd
commit
ca51e06ff7
@ -77,6 +77,8 @@ class StockMarketBaiDu(StockMarketTemplate):
|
||||
rename_columns = {'turnoverratio': 'turnover_ratio', 'preClose': 'pre_close', 'range': 'change',
|
||||
'ratio': 'change_pct', 'time': 'trade_time'}
|
||||
result_df = pd.DataFrame(data=data, columns=keys).rename(columns=rename_columns)[self._MARKET_COLUMNS]
|
||||
if result_df.empty:
|
||||
return pd.DataFrame(data=[], columns=self._MARKET_COLUMNS)
|
||||
result_df['stock_code'] = stock_code
|
||||
result_df['trade_date'] = result_df['trade_time']
|
||||
result_df['trade_time'] = pd.to_datetime(result_df['trade_time']).dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
@ -1,4 +1,4 @@
|
||||
requests>=2.16.0
|
||||
pandas>=1.1.5
|
||||
pandas>=0.22.0
|
||||
beautifulsoup4>=4.0.2
|
||||
py_mini_racer>=0.6.0
|
Loading…
Reference in New Issue
Block a user