File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import adata
22import pandas as pd
3- #显示所有列
3+ import akshare as ak
4+
5+ # 显示所有列
46pd .set_option ('display.max_columns' , None )
5- #显示所有行
7+ # 显示所有行
68pd .set_option ('display.max_rows' , None )
7- #设置value的显示长度为100,默认为50
8- pd .set_option ('max_colwidth' ,100 )
9+ # 设置value的显示长度为100,默认为50
10+ pd .set_option ('max_colwidth' , 100 )
911# k_type: k线类型:1.日;2.周;3.月 默认:1 日k
10- res_df = adata .stock .market .get_market (stock_code = '000001 ' , k_type = 1 , start_date = '2023-01-01' )
12+ res_df = adata .stock .market .get_market (stock_code = '688678 ' , k_type = 1 , start_date = '2023-01-01' )
1113print (res_df )
1214column_data = res_df ['change' ]
13- print (column_data )
15+ print (column_data )
16+
17+
18+ stock_zh_a_spot_em_df = ak .stock_zh_a_spot_em ()
19+ print (stock_zh_a_spot_em_df )
Original file line number Diff line number Diff line change 1+ import akshare as ak
2+ import pandas as pd
3+ # 显示所有列
4+ pd .set_option ('display.max_columns' , None )
5+ # 显示所有行
6+ pd .set_option ('display.max_rows' , None )
7+ # 设置value的显示长度为100,默认为50
8+ pd .set_option ('max_colwidth' , 100 )
9+
10+ stock_zh_a_spot_em_df = ak .stock_zh_a_spot_em ()
11+ print (stock_zh_a_spot_em_df )
12+
13+ with open ('output.txt' , 'w' ) as file :
14+ file .write (str (stock_zh_a_spot_em_df ))
You can’t perform that action at this time.
0 commit comments