先上结论:

本文主要工作体现在数据采集和数据处理上,从数据中得到结论还是一项暂不成熟的工作,但至少可以发现如下事项:
1、2017、2018年电信网络类设备供应商的营业收入逐年走高,与所称的大环境不理想状态相反;
2、2019年1季度各公司应收账款与营业收入持平,甚至应收账款更高,是一件难以解释的事情。至少在不了解特定情况下是如此;
3、剑桥科技股价最高,因为其股份数量少;
4、各公司研发费用在数量级上基本相当,并没有给人惊艳的感觉。

603083

确定需要分析的个股

In [33]:
%run py/first_import.py
['603083', '002281', '002369', '603118']
['sz002281', 'sh603083', 'sz002369', 'sh603118']

数据采集

In [34]:
%run py/banlance_sheet.py
%run py/income_statement.py
%run py/cashflow.py
%run py/category_sales.py
%run py/basic_financial_kpi.py
%run py/Profitability.py
%run py/Repayment_ability.py
%run py/Growth_ability.py
%run py/Operational_capability.py
%run py/accounts_receivable_notes_receivable_advance_receipts.py
%run py/Market_Value.py
%run py/Price_Market_Value.py
banlance_sheet is ok.
income_statement is ok.
cashflow is ok.
category_sales is ok.
basic_financial_kpi is ok.
Profitability is ok.
Repayment_ability is ok.
Growth_ability is ok.
Operational_capability is ok.
accounts_receivable_notes_receivable_advance_receipts is ok.
eastmoney data is ok.
Price_Market_Value is ok.

市值与市价对比

In [3]:
%run py/mv_vs_p.py
mv_vs_p()
              Date  Price  MarketValue(Billion)  Mv_Per_Stock
index                                                        
603118  2019-06-17   8.64                  6.72          8.66
603083  2019-06-17  29.34                  3.81         57.71
002369  2019-06-17   7.79                  4.54         10.81
002281  2019-06-17  26.22                 17.83         28.35
In [4]:
df=pd.read_csv('Price_Market_Value.txt', dtype={'index':str}).set_index('index')
df=df.iloc[0:,[1,3,4,5]]
df.plot(kind='barh',grid=True, figsize=(14,4), rot=0)
df.sort_index(ascending=False)
Out[4]:
Date Price MarketValue(Billion) Mv_Per_Stock
index
603118 2019-06-17 8.64 6.72 8.66
603083 2019-06-17 29.34 3.81 57.71
002369 2019-06-17 7.79 4.54 10.81
002281 2019-06-17 26.22 17.83 28.35

综合主营业务收入比较

In [5]:
stock_pooling=stock_list
df_sales=pd.DataFrame()
for i in stock_pooling:
    file_item=[i,'/',i,'_income_statement.txt']
    file=''.join(file_item)
    df=pd.read_csv(file,index_col='index_date')
    df=df.iloc[:,1].astype(float).to_frame()
    df.columns=[i]
    df_sales=pd.concat([df_sales, df], axis=1, sort=False, join='outer') 
df_sales=df_sales.T.sort_index(ascending=False).T.fillna(0)
df_sales.sort_index(ascending=True,inplace=True) #.plot(kind='line',grid=True, figsize=(10,4), rot=0)
figure, ax=plt.subplots(1, 1, figsize=(14, 4))
x=df_sales.index
y1,y2,y3,y4=df_sales['603083'], df_sales['002281'], df_sales['002369'], df_sales['603118']
ax.plot(x, y1, 'o-') 
ax.plot(x, y2, 'o-') 
ax.plot(x, y3, 'o-') 
ax.plot(x, y4, 'o-') 
ax.set_title('Sales' + '\nwww.jasper.wang')
ax.yaxis.set_ticks_position('right') 
ax.grid(True)
ax.legend(loc=0,fontsize=15)
plt.tight_layout()
plt.show()
df_sales.T.sort_index(ascending=False).T.sort_index(ascending=False)
Out[5]:
603118 603083 002369 002281
2019-03-31 203107.00 69030.00 56714.00 121908.00
2018-12-31 833394.00 315632.00 314462.00 492905.00
2017-12-31 755533.00 248654.00 276325.00 455307.00
2016-12-31 654303.00 199789.00 269798.00 405921.00
2015-12-31 653243.00 264423.00 377947.00 313998.00
2014-12-31 551555.00 175810.00 358688.00 243305.00
2013-12-31 498214.00 87038.00 204362.00 213270.00
2012-12-31 499473.00 0.00 146982.00 210366.00
2011-12-31 390643.00 0.00 123760.00 110725.00
2010-12-31 0.00 0.00 87054.00 91436.00
2009-12-31 0.00 0.00 51694.00 73048.00
2008-12-31 0.00 0.00 37620.00 65384.00
2007-12-31 0.00 0.00 33321.00 48769.00
2006-12-31 0.00 0.00 0.00 41185.00

综合毛利率比较

In [6]:
stock_pooling=stock_list
df_g=pd.DataFrame()
df_sales=pd.DataFrame()
for i in stock_pooling:
    file_item=[i,'/',i,'_income_statement.txt']
    file=''.join(file_item)
    df=pd.read_csv(file,index_col='index_date')
    df=df.iloc[:,[1,8]]
    df['GPM']=df.apply(lambda x: x[0]-x[1], axis=1)
    df['GPR']=df.apply(lambda x: x[2]/x[0], axis=1)
    df=df.iloc[:,3].to_frame().astype(float)
    df.columns=[i]
    df.index.set_names('index_date', inplace=True)
    if df_g.empty == True:
        df_g = df
    df_g=pd.concat([df,df_g],axis=1, sort=True).fillna(0)
df_g=df_g.T.sort_index(ascending=False)
df_g.drop_duplicates(inplace=True)
df_g=df_g.T
figure, ax=plt.subplots(1, 1, figsize=(14, 4))
x=df_g.index
y1,y2,y3,y4=df_g['603083'], df_g['002281'], df_g['002369'], df_g['603118']
ax.plot(x, y1, 'o-') 
ax.plot(x, y2, 'o-') 
ax.plot(x, y3, 'o-') 
ax.plot(x, y4, 'o-') 
ax.set_title('GPR' + '\nwww.jasper.wang')
ax.yaxis.set_ticks_position('right') 
ax.grid(True)
ax.legend(loc=0,fontsize=15)
plt.tight_layout()
plt.show()    

研发投入比较

费用化研发支出

In [7]:
stock_pooling=stock_list
df_sales=pd.DataFrame()
for i in stock_pooling:
    file_item=[i,'/',i,'_income_statement.txt']
    file=''.join(file_item)
    df=pd.read_csv(file,index_col='index_date')
    df=df.iloc[:,12].replace("--","0").astype(float).to_frame()
    df.columns=[i] 
    df_sales=pd.concat([df_sales, df], axis=1, sort=False, join='outer') 
df_sales=df_sales.T.sort_index(ascending=False).T.fillna(0)
df_sales.sort_index(ascending=True,inplace=True) #.plot(kind='line',grid=True, figsize=(10,4), rot=0)
figure, ax=plt.subplots(1, 1, figsize=(14, 4))
x=df_sales.index
y1,y2,y3,y4=df_sales['603083'], df_sales['002281'], df_sales['002369'], df_sales['603118']
ax.plot(x, y1, 'o-') 
ax.plot(x, y2, 'o-') 
ax.plot(x, y3, 'o-') 
ax.plot(x, y4, 'o-') 
ax.set_title('Sales' + '\nwww.jasper.wang')
ax.yaxis.set_ticks_position('right') 
ax.grid(True)
ax.legend(loc=0,fontsize=15)
plt.tight_layout()
plt.show()
df_sales.T.sort_index(ascending=False).T.sort_index(ascending=False)
Out[7]:
603118 603083 002369 002281
2019-03-31 9854.00 4467.00 2705.00 7697.00
2018-12-31 38057.00 13115.00 10536.00 39531.00
2017-12-31 0.00 0.00 0.00 0.00
2016-12-31 0.00 0.00 0.00 0.00
2015-12-31 0.00 0.00 0.00 0.00
2014-12-31 0.00 0.00 0.00 0.00
2013-12-31 0.00 0.00 0.00 0.00
2012-12-31 0.00 0.00 0.00 0.00
2011-12-31 0.00 0.00 0.00 0.00
2010-12-31 0.00 0.00 0.00 0.00
2009-12-31 0.00 0.00 0.00 0.00
2008-12-31 0.00 0.00 0.00 0.00
2007-12-31 0.00 0.00 0.00 0.00
2006-12-31 0.00 0.00 0.00 0.00

资本化研发支出

In [8]:
stock_pooling=stock_list
df_sales=pd.DataFrame()
for i in stock_pooling:
    file_item=[i,'/',i,'_banlance_sheet.txt']
    file=''.join(file_item)
    df=pd.read_csv(file,index_col='index_date')
    df=df.iloc[:,44].replace("--","0").astype(float).to_frame()
    df.columns=[i] 
    df_sales=pd.concat([df_sales, df], axis=1, sort=False, join='outer') 
df_sales=df_sales.T.sort_index(ascending=False).T.fillna(0)
df_sales.sort_index(ascending=True,inplace=True) #.plot(kind='line',grid=True, figsize=(10,4), rot=0)
figure, ax=plt.subplots(1, 1, figsize=(14, 4))
x=df_sales.index
y1,y2,y3,y4=df_sales['603083'], df_sales['002281'], df_sales['002369'], df_sales['603118']
ax.plot(x, y1, 'o-') 
ax.plot(x, y2, 'o-') 
ax.plot(x, y3, 'o-') 
ax.plot(x, y4, 'o-') 
ax.set_title('Sales' + '\nwww.jasper.wang')
ax.yaxis.set_ticks_position('right') 
ax.grid(True)
ax.legend(loc=0,fontsize=15)
plt.tight_layout()
plt.show()
df_sales.T.sort_index(ascending=False).T.sort_index(ascending=False)
Out[8]:
603118 603083 002369 002281
2019-03-31 1360.00 5679.00 0.00 7272.00
2018-12-31 1272.00 7199.00 0.00 5389.00
2017-12-31 941.00 7236.00 0.00 3645.00
2016-12-31 0.00 0.00 0.00 0.00
2015-12-31 0.00 0.00 0.00 0.00
2014-12-31 0.00 0.00 0.00 0.00
2013-12-31 0.00 0.00 0.00 0.00
2012-12-31 0.00 0.00 0.00 0.00
2011-12-31 0.00 0.00 0.00 0.00
2010-12-31 0.00 0.00 0.00 0.00
2009-12-31 0.00 0.00 0.00 0.00
2008-12-31 0.00 0.00 0.00 0.00
2007-12-31 0.00 0.00 0.00 0.00
2006-12-31 0.00 0.00 0.00 0.00

EBIT比较

EBIT中间数据处理

In [9]:
stock_pooling=stock_list
for i in stock_pooling:
    filename_from_frag='_income_statement.txt'
    filename_from_null=''
    filename_from_list=[i,'/',i,filename_from_frag]
    filename_from=filename_from_null.join(filename_from_list)
    df=pd.read_csv(filename_from, index_col='index_date')
    df=df.loc[:,['营业收入(万元)','营业成本(万元)','营业税金及附加(万元)','销售费用(万元)','管理费用(万元)']].replace('--','0')
    df['EBIT'] = df.apply(lambda x: x['营业收入(万元)']-x['营业成本(万元)']-x['营业税金及附加(万元)']-x['销售费用(万元)']-x['管理费用(万元)'], axis=1)
    df=df.sort_index(ascending=True)
    filename_to_null=''
    filename_to=filename_to_null.join([i,'/',i,'_EBIT.txt'])
    df.to_csv(filename_to)

EBIT比较

In [10]:
stock_pooling=stock_list
df_e=pd.DataFrame()
df_sales=pd.DataFrame()
for i in stock_pooling:
    file_item=[i,'/',i,'_EBIT.txt']
    file=''.join(file_item)
    df=pd.read_csv(file,index_col='index_date')
    df=df.iloc[:,5].to_frame().astype(float)
    df.columns=[i]
    df.index.set_names('index_date', inplace=True)
    if df_e.empty == True:
        df_e = df
    df_e=pd.concat([df,df_e],axis=1, sort=True).fillna(0)
df_e=df_e.T.sort_index(ascending=False)
df_e.drop_duplicates(inplace=True)
df_e=df_e.T
figure, ax=plt.subplots(1, 1, figsize=(14, 4))
x=df_e.index
y1,y2,y3,y4=df_e['603083'], df_e['002281'], df_e['002369'], df_e['603118']
ax.plot(x, y1, 'o-') 
ax.plot(x, y2, 'o-') 
ax.plot(x, y3, 'o-') 
ax.plot(x, y4, 'o-') 
ax.set_title('EBIT' + '\nwww.jasper.wang')
ax.yaxis.set_ticks_position('right') 
ax.grid(True)
ax.legend(loc=0,fontsize=15)
plt.tight_layout()
plt.show()

现金流

603083 剑桥科技

In [11]:
dfcash_all=pd.read_csv('603083/603083_cashflow.txt',index_col='index_date')
dfcash=dfcash_all.iloc[:,[24,39,51]].replace('--','0')
dfcash.columns=['Operating','Investing','Financing']
dfcash.sort_index(ascending=True, inplace=True)
figure, ax=plt.subplots(1, 1, figsize=(14, 4))
x=dfcash.index
y1,y2, y3 = dfcash['Operating'], dfcash['Investing'], dfcash['Financing']
ax.plot(x, y1, 'r-')
ax.plot(x, y2, 'g-')
ax.plot(x, y3, 'b-')
ax.set_title('Cashflow' + '\nwww.jasper.wang')
ax.yaxis.set_ticks_position('right') 
ax.grid(True)
ax.legend(loc=2)
plt.tight_layout()
plt.show()
df=dfcash_all.iloc[:,-5].to_frame().sort_index(ascending=True)
df.columns=['Cash balance']
print(df.plot(kind='bar',grid=True, figsize=(16,2), rot=0, secondary_y = True))
AxesSubplot(0.125,0.125;0.775x0.755)

603118 共进股份

In [12]:
dfcash_all=pd.read_csv('603118/603118_cashflow.txt',index_col='index_date')
dfcash=dfcash_all.iloc[:,[24,39,51]].replace('--','0')
dfcash.columns=['Operating','Investing','Financing']
dfcash.sort_index(ascending=True, inplace=True)
figure, ax=plt.subplots(1, 1, figsize=(14, 4))
x=dfcash.index
y1,y2, y3 = dfcash['Operating'], dfcash['Investing'], dfcash['Financing']
ax.plot(x, y1, 'r-')
ax.plot(x, y2, 'g-')
ax.plot(x, y3, 'b-')
ax.set_title('Cashflow' + '\nwww.jasper.wang')
ax.yaxis.set_ticks_position('right') 
ax.grid(True)
ax.legend(loc=2)
plt.tight_layout()
plt.show()
df=dfcash_all.iloc[:,-5].to_frame().sort_index(ascending=True)
df.columns=['Cash balance']
print(df.plot(kind='bar',grid=True, figsize=(16,2), rot=0, secondary_y = True))
AxesSubplot(0.125,0.125;0.775x0.755)

002281 光迅科技

In [13]:
dfcash_all=pd.read_csv('002281/002281_cashflow.txt',index_col='index_date')
dfcash=dfcash_all.iloc[:,[24,39,51]].replace('--','0')
dfcash.columns=['Operating','Investing','Financing']
dfcash.sort_index(ascending=True, inplace=True)
figure, ax=plt.subplots(1, 1, figsize=(14, 4))
x=dfcash.index
y1,y2, y3 = dfcash['Operating'], dfcash['Investing'], dfcash['Financing']
ax.plot(x, y1, 'r-')
ax.plot(x, y2, 'g-')
ax.plot(x, y3, 'b-')
ax.set_title('Cashflow' + '\nwww.jasper.wang')
ax.yaxis.set_ticks_position('right') 
ax.grid(True)
ax.legend(loc=2)
plt.tight_layout()
plt.show()
df=dfcash_all.iloc[:,-5].to_frame().sort_index(ascending=True)
df.columns=['Cash balance']
print(df.plot(kind='bar',grid=True, figsize=(16,2), rot=0, secondary_y = True))
AxesSubplot(0.125,0.125;0.775x0.755)

002369 卓翼科技

In [14]:
dfcash_all=pd.read_csv('002369/002369_cashflow.txt',index_col='index_date')
dfcash=dfcash_all.iloc[:,[24,39,51]].replace('--','0')
dfcash.columns=['Operating','Investing','Financing']
dfcash.sort_index(ascending=True, inplace=True)
figure, ax=plt.subplots(1, 1, figsize=(14, 4))
x=dfcash.index
y1,y2, y3 = dfcash['Operating'], dfcash['Investing'], dfcash['Financing']
ax.plot(x, y1, 'r-')
ax.plot(x, y2, 'g-')
ax.plot(x, y3, 'b-')
ax.set_title('Cashflow' + '\nwww.jasper.wang')
ax.yaxis.set_ticks_position('right') 
ax.grid(True)
ax.legend(loc=2)
plt.tight_layout()
plt.show()
df=dfcash_all.iloc[:,-5].to_frame().sort_index(ascending=True)
df.columns=['Cash balance']
print(df.plot(kind='bar',grid=True, figsize=(16,2), rot=0, secondary_y = True))
AxesSubplot(0.125,0.125;0.775x0.755)

应收账款+应收票据(与主营业务收入比较)

603083 剑桥科技

In [15]:
df_1=pd.read_csv('603083/603083_income_statement.txt',index_col='index_date')
df_1=df_1.iloc[:,1].to_frame()*10000
df_1.columns=['Sales']
df_2=pd.read_csv('603083/603083_banlance_sheet.txt',index_col='index_date')
df_2=df_2.iloc[:,[5,6]].replace('--','0').astype(float)*10000
df_2['AR_BR']=df_2.apply(lambda x: x[0]+x[1], axis=1)
df_2=df_2.iloc[:,2].to_frame()
df=pd.concat([df_1,df_2], axis=1, sort=True)
print(df.plot(kind='bar',grid=True, figsize=(14,4), rot=0, secondary_y = True))
df_g=df.pct_change()
print(df_g.plot(kind='line',grid=True, figsize=(14,2), rot=0, secondary_y = True, xticks=range(len(df_g.index))))
AxesSubplot(0.125,0.125;0.775x0.755)
AxesSubplot(0.125,0.125;0.775x0.755)

603118 共进股份

In [16]:
df_1=pd.read_csv('603118/603118_income_statement.txt',index_col='index_date')
df_1=df_1.iloc[:,1].to_frame()*10000
df_1.columns=['Sales']
df_2=pd.read_csv('603118/603118_banlance_sheet.txt',index_col='index_date')
df_2=df_2.iloc[:,[5,6]].replace('--','0').astype(float)*10000
df_2['AR_BR']=df_2.apply(lambda x: x[0]+x[1], axis=1)
df_2=df_2.iloc[:,2].to_frame()
df=pd.concat([df_1,df_2], axis=1, sort=True)
print(df.plot(kind='bar',grid=True, figsize=(14,4), rot=0, secondary_y = True))
df_g=df.pct_change()
print(df_g.plot(kind='line',grid=True, figsize=(14,2), rot=0, secondary_y = True, xticks=range(len(df_g.index))))
AxesSubplot(0.125,0.125;0.775x0.755)
AxesSubplot(0.125,0.125;0.775x0.755)

002281 光迅科技

In [17]:
df_1=pd.read_csv('002281/002281_income_statement.txt',index_col='index_date')
df_1=df_1.iloc[:,1].to_frame()*10000
df_1.columns=['Sales']
df_2=pd.read_csv('002281/002281_banlance_sheet.txt',index_col='index_date')
df_2=df_2.iloc[:,[5,6]].replace('--','0').astype(float)*10000
df_2['AR_BR']=df_2.apply(lambda x: x[0]+x[1], axis=1)
df_2=df_2.iloc[:,2].to_frame()
df=pd.concat([df_1,df_2], axis=1, sort=True)
print(df.plot(kind='bar',grid=True, figsize=(14,4), rot=0, secondary_y = True))
df_g=df.pct_change()
print(df_g.plot(kind='line',grid=True, figsize=(14,2), rot=0, secondary_y = True, xticks=range(len(df_g.index))))
AxesSubplot(0.125,0.125;0.775x0.755)
AxesSubplot(0.125,0.125;0.775x0.755)

002369 卓翼科技

In [18]:
df_1=pd.read_csv('002369/002369_income_statement.txt',index_col='index_date')
df_1=df_1.iloc[:,1].to_frame()*10000
df_1.columns=['Sales']
df_2=pd.read_csv('002369/002369_banlance_sheet.txt',index_col='index_date')
df_2=df_2.iloc[:,[5,6]].replace('--','0').astype(float)*10000
df_2['AR_BR']=df_2.apply(lambda x: x[0]+x[1], axis=1)
df_2=df_2.iloc[:,2].to_frame()
df=pd.concat([df_1,df_2], axis=1, sort=True)
print(df.plot(kind='bar',grid=True, figsize=(14,4), rot=0, secondary_y = True))
df_g=df.pct_change()
print(df_g.plot(kind='line',grid=True, figsize=(14,2), rot=0, secondary_y = True, xticks=range(len(df_g.index))))
AxesSubplot(0.125,0.125;0.775x0.755)
AxesSubplot(0.125,0.125;0.775x0.755)