Tushare is a free and open source python financial data interface package - get CSI 300

Tushare is a free, open source python financial data interface package.

Official website: http://tushare.org/

import tushare as ts
import pandas

pandas.set_option('max_rows',10000)
pandas.set_option('max_columns',10000)

print(ts.__version__)

result = ts.get_hs300s()
print(result)
print(type(result))
#print(result['name'])

#print(ts.get_hist_data('600848'))

#print(ts.get_stock_basics())

print(result) will only print the first 30 lines and the last 30 lines, so first check the type of result

print(type(result)):

<class 'pandas.core.frame.DataFrame'>
result类型是pandas.core.frame.DataFrame:

I checked it, because it is necessary to set the maximum display row and column of pandas, as follows:

pandas.set_option('max_rows',10000)

pandas.set_option('max_columns',10000)

In fact, this thing can also be done by writing regulars by yourself, but it is troublesome. Regulars are fast and flexible, but it is more troublesome to write. You can refer to the crawler I wrote with regulars before.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325026122&siteId=291194637