femme

大数据中心检索数据题

1、仔细认真,不急,但也要有时间观念,越快完成越好

2、理清楚逻辑,不行的直接就暴力丢excell里面去

3、注意效率,后面的题会更加浪费时间

4、及时与队友沟通,可以让队友帮忙

5、建议多进行自主训练,加快解题速度,提高解题准确率

编程检索数据题

ts_code的说明

600 开头的代码一般 是要以 .SH 结尾
上交所sh和深交所sz

总之在Python中一定要加上后缀 sz 或者 sh

monthly接口相关(月线接口)

一些参数

trade_date #交易日期
start_date #开始日期
end_date #结束日期
fields #最终需要的参数
open   #开盘价
high   #最高价
low    #最低价
close  #收盘价
pct_chg	# 未复权涨跌幅
import tushare as ts

pro = ts.pro_api(\'token\')

ds = pro.monthly(ts_code=\'600271.SH\', start_date=\'20131201\', end_date=\'20181231\', fields=\'trade_date,close\')

# 筛选数据
ds = ds[ds.trade_date.map(lambda x:x.find(\'12\',4,6)>=0)]

print(ds)

pro_bar 接口相关(通用行情接口)

一些参数

asset #资产类别:E股票 I沪深指数 C数字货币 FT期货 FD基金 O期权 CB可转债(v1.2.39),默认E
freq #数据频度 :支持分钟(min)/日(D)/周(W)/月(M)K线,其中1min表示1分钟(类推1/5/15/30/60分钟) ,默认D。
adj #复权类型(只针对股票):None未复权 qfq前复权 hfq后复权 , 默认None,目前只支持日线复权。
import tushare as ts
ts.set_token(\'token\')
ds = ts.pro_bar(ts_code=\'399101.SZ\', asset=\'I\', freq=\'M\', start_date=\'20130101\', end_date=\'20181231\')
# 其中 asset 为这个证券的类型,比如 E股票 I沪深指数,freq为数据频率(M代表月)

#筛选数据
ds = ds[ds.trade_date.map(lambda x:x.find(\'12\',4,6)>=0)]
ds = ds[[\'trade_date\',\'close\']]

print(ds)
import tushare as ts
import matplotlib as mp
import matplotlib.pyplot as plt
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()

# 抓取数据
ds = ts.pro_bar(ts_code=\'002193.SZ\', start_date=\'20180601\', end_date=\'20180630\', adj=\'None\')
ds.to_csv(\'D:/bigdata/如意集团2018年6月公司股价变动日收盘价.csv\')
# 清洗数据
df = ds[[\'trade_date\', \'high\']]
df.to_csv(\'D:/bigdata/如意集团2018年6月公司股价变动日最高价(已清洗).csv\')
print(df)

# 为了防止出现中文乱码,在这里进行一下设置
plt.rcParams[\'font.sans-serif\']=[\'SimSun\']
plt.rcParams[\'axes.unicode_minus\']=False

#生成折线图
x_cel = ds[\'trade_date\'] #取值给曲线x
y_col1 = ds[\'open\'] #取值给y
y_col2 = ds[\'close\']
y_col3 = ds[\'high\']
plt.figure(figsize=(9, 7)) #定义画布尺寸
plt.plot_date(x_cel, y_col1, \'-\', label=\'open price\') #画线以及定义线的类型和命名
plt.plot_date(x_cel, y_col2, \'-\', label=\'closing price\')
plt.plot_date(x_cel, y_col3, \'-\', label=\'peak price\')
plt.xlabel(\'日期\') #给x和y轴命名
plt.ylabel(\'指数\') 
plt.legend()  #给图像加上图例
plt.xticks(rotation=45) #将x轴的图例坐标值,倾斜 45度放置
plt.style.use(\'ggplot\')  #设置背景样式
plt.grid(True) #显示网格线
plt.title(\'如意集团2018年6月开盘价收盘价最高价折线图\', fontsize=10)
plt.savefig(\'D:/bigdata/如意集团开盘价收盘价最高折线图.png\')

balancesheet接口(资产负债表)

total_hldr_eqy_exc_min_int	#	股东权益合计(不含少数股东权益)
total_hldr_eqy_inc_min_int	#	股东权益合计(含少数股东权益)
total_liab	#	负债合计

题目

image

import tushare as ts
pro = ts.pro_api(\'token\')

df=pro.balancesheet(ts_code=\'300410.SZ\',start_date=\'20210101\', end_date=\'20210631\',fields=\'ts_code,end_date,total_hldr_eqy_inc_min_int,total_liab\')

df = df[df.end_date.map(lambda x:x.find(\'12\',4,6)>=0)]
df.to_csv(\'300410.csv\')
print(df)
产权比率=负债/权益=1570748408.55/629392801.51=2.5

根据资料的信息收集题

仔细阅读所给材料(一般是背景资料或者背景资料中的PDF)

PDF中也可进行文字搜索

寻找队友帮助

作者:~逍遥子~
本文连接: https://www.cnblogs.com/femme/p/15470833.html
版权:本人个人所有
转载请注明出处

分类:

技术点:

相关文章:

  • 2021-05-05
  • 2021-08-03
  • 2021-10-29
  • 2022-01-03
  • 2021-12-28
  • 2021-09-29
  • 2021-08-15
  • 2022-02-04
猜你喜欢
  • 2021-11-12
  • 2021-11-07
  • 2021-08-23
  • 2021-04-09
  • 2021-12-02
  • 2022-01-19
相关资源
相似解决方案