Commit fa4f0b67 authored by Dr.李's avatar Dr.李

change utilitiy

parent 5774831d
......@@ -40,14 +40,1035 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"id": "07275364-e308-433e-9c3a-fe78ad8e9daa",
"metadata": {},
"outputs": [],
"source": [
"# 获取所有目标债券型基金(清算结束日期晚于当前日)\n",
"\n",
"security_ids = fd_alive_funds(report_dates_begin, 3)"
"sec_codes = fd_alive_funds(report_dates_begin, 2, 203)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "ff5fb125-2ae9-4cc9-a1fd-22f52c79ed38",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['1030000011',\n",
" '1030000012',\n",
" '1030000014',\n",
" '1030000015',\n",
" '1030000022',\n",
" '1030000031',\n",
" '1030000042',\n",
" '1030000043',\n",
" '1030000049',\n",
" '1030000054',\n",
" '1030000059',\n",
" '1030000063',\n",
" '1030000074',\n",
" '1030000080',\n",
" '1030000084',\n",
" '1030000086',\n",
" '1030000101',\n",
" '1030000102',\n",
" '1030000108',\n",
" '1030000109',\n",
" '1030000112',\n",
" '1030000118',\n",
" '1030000124',\n",
" '1030000126',\n",
" '1030000131',\n",
" '1030000133',\n",
" '1030000135',\n",
" '1030000141',\n",
" '1030000173',\n",
" '1030000180',\n",
" '1030000195',\n",
" '1030000198',\n",
" '1030000201',\n",
" '1030000205',\n",
" '1030000234',\n",
" '1030000238',\n",
" '1030000241',\n",
" '1030000253',\n",
" '1030000279',\n",
" '1030000291',\n",
" '1030000292',\n",
" '1030000295',\n",
" '1030000296',\n",
" '1030000303',\n",
" '1030000311',\n",
" '1030000312',\n",
" '1030000314',\n",
" '1030000316',\n",
" '1030000318',\n",
" '1030000354',\n",
" '1030000360',\n",
" '1030000361',\n",
" '1030000364',\n",
" '1030000365',\n",
" '1030000380',\n",
" '1030000391',\n",
" '1030000495',\n",
" '1030000496',\n",
" '1030000499',\n",
" '1030000500',\n",
" '1030000502',\n",
" '1030000503',\n",
" '1030000505',\n",
" '1030000511',\n",
" '1030000512',\n",
" '1030000515',\n",
" '1030000516',\n",
" '1030000522',\n",
" '1030000528',\n",
" '1030000529',\n",
" '1030000532',\n",
" '1030000533',\n",
" '1030000534',\n",
" '1030000537',\n",
" '1030000543',\n",
" '1030000547',\n",
" '1030000548',\n",
" '1030000551',\n",
" '1030000552',\n",
" '1030000554',\n",
" '1030000555',\n",
" '1030000559',\n",
" '1030000565',\n",
" '1030000566',\n",
" '1030000569',\n",
" '1030000570',\n",
" '1030000574',\n",
" '1030000575',\n",
" '1030000576',\n",
" '1030000587',\n",
" '1030000588',\n",
" '1030000590',\n",
" '1030000591',\n",
" '1030000594',\n",
" '1030000595',\n",
" '1030000597',\n",
" '1030000598',\n",
" '1030000610',\n",
" '1030000611',\n",
" '1030000618',\n",
" '1030000619',\n",
" '1030000622',\n",
" '1030000623',\n",
" '1030000631',\n",
" '1030000632',\n",
" '1030000638',\n",
" '1030000639',\n",
" '1030000641',\n",
" '1030000642',\n",
" '1030000645',\n",
" '1030000646',\n",
" '1030000649',\n",
" '1030000655',\n",
" '1030000656',\n",
" '1030000680',\n",
" '1030000681',\n",
" '1030000687',\n",
" '1030000688',\n",
" '1030000694',\n",
" '1030000695',\n",
" '1030000696',\n",
" '1030000697',\n",
" '1030000713',\n",
" '1030000782',\n",
" '1030000783',\n",
" '1030000798',\n",
" '1030000802',\n",
" '1030000815',\n",
" '1030000816',\n",
" '1030000821',\n",
" '1030000822',\n",
" '1030000826',\n",
" '1030000827',\n",
" '1030000833',\n",
" '1030000838',\n",
" '1030000839',\n",
" '1030000860',\n",
" '1030000865',\n",
" '1030000866',\n",
" '1030000874',\n",
" '1030000875',\n",
" '1030000878',\n",
" '1030000885',\n",
" '1030000886',\n",
" '1030000888',\n",
" '1030000889',\n",
" '1030000966',\n",
" '1030000967',\n",
" '1030000975',\n",
" '1030000983',\n",
" '1030000988',\n",
" '1030000989',\n",
" '1030001009',\n",
" '1030001010',\n",
" '1030001011',\n",
" '1030001032',\n",
" '1030001033',\n",
" '1030001039',\n",
" '1030001050',\n",
" '1030001055',\n",
" '1030001056',\n",
" '1030001061',\n",
" '1030001062',\n",
" '1030001069',\n",
" '1030001070',\n",
" '1030001077',\n",
" '1030001079',\n",
" '1030001097',\n",
" '1030001099',\n",
" '1030001100',\n",
" '1030001112',\n",
" '1030001113',\n",
" '1030001114',\n",
" '1030001126',\n",
" '1030001132',\n",
" '1030001133',\n",
" '1030001136',\n",
" '1030001139',\n",
" '1030001140',\n",
" '1030001143',\n",
" '1030001144',\n",
" '1030001148',\n",
" '1030001149',\n",
" '1030001156',\n",
" '1030001159',\n",
" '1030001160',\n",
" '1030001163',\n",
" '1030001164',\n",
" '1030001166',\n",
" '1030001168',\n",
" '1030001169',\n",
" '1030001178',\n",
" '1030001179',\n",
" '1030001190',\n",
" '1030001191',\n",
" '1030001198',\n",
" '1030001199',\n",
" '1030001217',\n",
" '1030001218',\n",
" '1030001229',\n",
" '1030001230',\n",
" '1030001254',\n",
" '1030001268',\n",
" '1030001271',\n",
" '1030001272',\n",
" '1030001274',\n",
" '1030001276',\n",
" '1030001280',\n",
" '1030001281',\n",
" '1030001296',\n",
" '1030001298',\n",
" '1030001304',\n",
" '1030001306',\n",
" '1030001310',\n",
" '1030001311',\n",
" '1030001313',\n",
" '1030001314',\n",
" '1030001337',\n",
" '1030001340',\n",
" '1030001342',\n",
" '1030001346',\n",
" '1030001347',\n",
" '1030001380',\n",
" '1030001381',\n",
" '1030001389',\n",
" '1030001390',\n",
" '1030001407',\n",
" '1030001414',\n",
" '1030001417',\n",
" '1030001418',\n",
" '1030001428',\n",
" '1030001432',\n",
" '1030001441',\n",
" '1030001442',\n",
" '1030001452',\n",
" '1030001455',\n",
" '1030001458',\n",
" '1030001459',\n",
" '1030001477',\n",
" '1030001481',\n",
" '1030001492',\n",
" '1030001493',\n",
" '1030001500',\n",
" '1030001501',\n",
" '1030001502',\n",
" '1030001503',\n",
" '1030001512',\n",
" '1030001519',\n",
" '1030001520',\n",
" '1030001524',\n",
" '1030001525',\n",
" '1030001533',\n",
" '1030001538',\n",
" '1030001539',\n",
" '1030001543',\n",
" '1030001545',\n",
" '1030001546',\n",
" '1030001547',\n",
" '1030001553',\n",
" '1030001554',\n",
" '1030001560',\n",
" '1030001564',\n",
" '1030001565',\n",
" '1030001576',\n",
" '1030001577',\n",
" '1030001580',\n",
" '1030001581',\n",
" '1030001588',\n",
" '1030001589',\n",
" '1030001600',\n",
" '1030001604',\n",
" '1030001610',\n",
" '1030001611',\n",
" '1030001614',\n",
" '1030001615',\n",
" '1030001626',\n",
" '1030001629',\n",
" '1030001630',\n",
" '1030001633',\n",
" '1030001634',\n",
" '1030001644',\n",
" '1030001645',\n",
" '1030001646',\n",
" '1030001648',\n",
" '1030001649',\n",
" '1030001658',\n",
" '1030001659',\n",
" '1030001662',\n",
" '1030001663',\n",
" '1030001664',\n",
" '1030001667',\n",
" '1030001668',\n",
" '1030001671',\n",
" '1030001672',\n",
" '1030001674',\n",
" '1030001675',\n",
" '1030001681',\n",
" '1030001682',\n",
" '1030001686',\n",
" '1030001687',\n",
" '1030001693',\n",
" '1030001696',\n",
" '1030001697',\n",
" '1030001699',\n",
" '1030001700',\n",
" '1030001701',\n",
" '1030001703',\n",
" '1030001704',\n",
" '1030001710',\n",
" '1030001711',\n",
" '1030001713',\n",
" '1030001714',\n",
" '1030001716',\n",
" '1030001717',\n",
" '1030001721',\n",
" '1030001723',\n",
" '1030001724',\n",
" '1030001726',\n",
" '1030001727',\n",
" '1030001730',\n",
" '1030001732',\n",
" '1030001733',\n",
" '1030001735',\n",
" '1030001736',\n",
" '1030001738',\n",
" '1030001739',\n",
" '1030001741',\n",
" '1030001742',\n",
" '1030001744',\n",
" '1030001745',\n",
" '1030001749',\n",
" '1030001750',\n",
" '1030001752',\n",
" '1030001753',\n",
" '1030001755',\n",
" '1030001756',\n",
" '1030001760',\n",
" '1030001761',\n",
" '1030001766',\n",
" '1030001768',\n",
" '1030001770',\n",
" '1030001772',\n",
" '1030001773',\n",
" '1030001775',\n",
" '1030001779',\n",
" '1030001780',\n",
" '1030001782',\n",
" '1030001783',\n",
" '1030001786',\n",
" '1030001787',\n",
" '1030001795',\n",
" '1030001798',\n",
" '1030001799',\n",
" '1030001801',\n",
" '1030001802',\n",
" '1030001804',\n",
" '1030001805',\n",
" '1030001806',\n",
" '1030001807',\n",
" '1030001808',\n",
" '1030001811',\n",
" '1030001812',\n",
" '1030001814',\n",
" '1030001815',\n",
" '1030001817',\n",
" '1030001818',\n",
" '1030001829',\n",
" '1030001830',\n",
" '1030001831',\n",
" '1030001834',\n",
" '1030001835',\n",
" '1030001836',\n",
" '1030001838',\n",
" '1030001839',\n",
" '1030001840',\n",
" '1030001843',\n",
" '1030001844',\n",
" '1030001845',\n",
" '1030001846',\n",
" '1030001851',\n",
" '1030001852',\n",
" '1030001863',\n",
" '1030001865',\n",
" '1030001866',\n",
" '1030001867',\n",
" '1030001872',\n",
" '1030001873',\n",
" '1030001875',\n",
" '1030001880',\n",
" '1030001881',\n",
" '1030001886',\n",
" '1030001887',\n",
" '1030001889',\n",
" '1030001890',\n",
" '1030001894',\n",
" '1030001896',\n",
" '1030001897',\n",
" '1030001903',\n",
" '1030001904',\n",
" '1030001906',\n",
" '1030001907',\n",
" '1030001909',\n",
" '1030001910',\n",
" '1030001912',\n",
" '1030001913',\n",
" '1030001916',\n",
" '1030001917',\n",
" '1030001919',\n",
" '1030001920',\n",
" '1030001921',\n",
" '1030001929',\n",
" '1030001930',\n",
" '1030001934',\n",
" '1030001936',\n",
" '1030001937',\n",
" '1030001939',\n",
" '1030001944',\n",
" '1030001946',\n",
" '1030001947',\n",
" '1030001952',\n",
" '1030001958',\n",
" '1030001959',\n",
" '1030001964',\n",
" '1030001965',\n",
" '1030001967',\n",
" '1030001968',\n",
" '1030001970',\n",
" '1030001971',\n",
" '1030001973',\n",
" '1030001974',\n",
" '1030001976',\n",
" '1030001977',\n",
" '1030001982',\n",
" '1030001988',\n",
" '1030001989',\n",
" '1030001990',\n",
" '1030001994',\n",
" '1030001995',\n",
" '1030001997',\n",
" '1030002003',\n",
" '1030002004',\n",
" '1030002007',\n",
" '1030002008',\n",
" '1030002009',\n",
" '1030002010',\n",
" '1030002016',\n",
" '1030002021',\n",
" '1030002022',\n",
" '1030002025',\n",
" '1030002028',\n",
" '1030002029',\n",
" '1030002047',\n",
" '1030002048',\n",
" '1030002051',\n",
" '1030002057',\n",
" '1030002058',\n",
" '1030002061',\n",
" '1030002062',\n",
" '1030002064',\n",
" '1030002066',\n",
" '1030002067',\n",
" '1030002068',\n",
" '1030002070',\n",
" '1030002074',\n",
" '1030002079',\n",
" '1030002080',\n",
" '1030002082',\n",
" '1030002083',\n",
" '1030002085',\n",
" '1030002089',\n",
" '1030002090',\n",
" '1030002098',\n",
" '1030002100',\n",
" '1030002106',\n",
" '1030002107',\n",
" '1030002109',\n",
" '1030002110',\n",
" '1030002116',\n",
" '1030002119',\n",
" '1030002127',\n",
" '1030002129',\n",
" '1030002130',\n",
" '1030002134',\n",
" '1030002135',\n",
" '1030002137',\n",
" '1030002138',\n",
" '1030002140',\n",
" '1030002145',\n",
" '1030002151',\n",
" '1030002152',\n",
" '1030002153',\n",
" '1030002156',\n",
" '1030002157',\n",
" '1030002162',\n",
" '1030002164',\n",
" '1030002165',\n",
" '1030002173',\n",
" '1030002174',\n",
" '1030002178',\n",
" '1030002179',\n",
" '1030002181',\n",
" '1030002182',\n",
" '1030002186',\n",
" '1030002189',\n",
" '1030002191',\n",
" '1030002193',\n",
" '1030002194',\n",
" '1030002195',\n",
" '1030002196',\n",
" '1030002197',\n",
" '1030002201',\n",
" '1030002202',\n",
" '1030002204',\n",
" '1030002205',\n",
" '1030002208',\n",
" '1030002209',\n",
" '1030002216',\n",
" '1030002217',\n",
" '1030002225',\n",
" '1030002226',\n",
" '1030002228',\n",
" '1030002229',\n",
" '1030002233',\n",
" '1030002234',\n",
" '1030002236',\n",
" '1030002237',\n",
" '1030002241',\n",
" '1030002242',\n",
" '1030002244',\n",
" '1030002245',\n",
" '1030002247',\n",
" '1030002248',\n",
" '1030002249',\n",
" '1030002253',\n",
" '1030002254',\n",
" '1030002256',\n",
" '1030002257',\n",
" '1030002259',\n",
" '1030002260',\n",
" '1030002262',\n",
" '1030002264',\n",
" '1030002266',\n",
" '1030002267',\n",
" '1030002269',\n",
" '1030002270',\n",
" '1030002279',\n",
" '1030002280',\n",
" '1030002295',\n",
" '1030002296',\n",
" '1030002298',\n",
" '1030002304',\n",
" '1030002305',\n",
" '1030002307',\n",
" '1030002308',\n",
" '1030002311',\n",
" '1030002312',\n",
" '1030002313',\n",
" '1030002315',\n",
" '1030002316',\n",
" '1030002322',\n",
" '1030002323',\n",
" '1030002325',\n",
" '1030002327',\n",
" '1030002328',\n",
" '1030002330',\n",
" '1030002332',\n",
" '1030002333',\n",
" '1030002334',\n",
" '1030002343',\n",
" '1030002344',\n",
" '1030002345',\n",
" '1030002352',\n",
" '1030002353',\n",
" '1030002360',\n",
" '1030002364',\n",
" '1030002371',\n",
" '1030002372',\n",
" '1030002377',\n",
" '1030002383',\n",
" '1030002384',\n",
" '1030002386',\n",
" '1030002387',\n",
" '1030002390',\n",
" '1030002391',\n",
" '1030002393',\n",
" '1030002394',\n",
" '1030002401',\n",
" '1030002402',\n",
" '1030002403',\n",
" '1030002411',\n",
" '1030002416',\n",
" '1030002417',\n",
" '1030002419',\n",
" '1030002420',\n",
" '1030002423',\n",
" '1030002424',\n",
" '1030002431',\n",
" '1030002433',\n",
" '1030002434',\n",
" '1030002436',\n",
" '1030002437',\n",
" '1030002441',\n",
" '1030002442',\n",
" '1030002448',\n",
" '1030002449',\n",
" '1030002450',\n",
" '1030002458',\n",
" '1030002459',\n",
" '1030002460',\n",
" '1030002463',\n",
" '1030002464',\n",
" '1030002465',\n",
" '1030002466',\n",
" '1030002469',\n",
" '1030002473',\n",
" '1030002474',\n",
" '1030002479',\n",
" '1030002482',\n",
" '1030002483',\n",
" '1030002485',\n",
" '1030002486',\n",
" '1030002488',\n",
" '1030002489',\n",
" '1030002495',\n",
" '1030002496',\n",
" '1030002498',\n",
" '1030002499',\n",
" '1030002504',\n",
" '1030002505',\n",
" '1030002506',\n",
" '1030002513',\n",
" '1030002514',\n",
" '1030002516',\n",
" '1030002517',\n",
" '1030002518',\n",
" '1030002519',\n",
" '1030002520',\n",
" '1030002523',\n",
" '1030002524',\n",
" '1030002526',\n",
" '1030002527',\n",
" '1030002530',\n",
" '1030002531',\n",
" '1030002541',\n",
" '1030002543',\n",
" '1030002544',\n",
" '1030002545',\n",
" '1030002546',\n",
" '1030002547',\n",
" '1030002548',\n",
" '1030002549',\n",
" '1030002550',\n",
" '1030002554',\n",
" '1030002557',\n",
" '1030002558',\n",
" '1030002559',\n",
" '1030002561',\n",
" '1030002564',\n",
" '1030002565',\n",
" '1030002566',\n",
" '1030002567',\n",
" '1030002568',\n",
" '1030002570',\n",
" '1030002571',\n",
" '1030002575',\n",
" '1030002576',\n",
" '1030002581',\n",
" '1030002582',\n",
" '1030002585',\n",
" '1030002586',\n",
" '1030002587',\n",
" '1030002588',\n",
" '1030002589',\n",
" '1030002593',\n",
" '1030002594',\n",
" '1030002597',\n",
" '1030002600',\n",
" '1030002605',\n",
" '1030002606',\n",
" '1030002608',\n",
" '1030002619',\n",
" '1030002620',\n",
" '1030002621',\n",
" '1030002622',\n",
" '1030002625',\n",
" '1030002626',\n",
" '1030002627',\n",
" '1030002628',\n",
" '1030002629',\n",
" '1030002639',\n",
" '1030002640',\n",
" '1030002645',\n",
" '1030002646',\n",
" '1030002648',\n",
" '1030002652',\n",
" '1030002653',\n",
" '1030002654',\n",
" '1030002658',\n",
" '1030002659',\n",
" '1030002661',\n",
" '1030002667',\n",
" '1030002668',\n",
" '1030002672',\n",
" '1030002674',\n",
" '1030002675',\n",
" '1030002682',\n",
" '1030002683',\n",
" '1030002685',\n",
" '1030002694',\n",
" '1030002695',\n",
" '1030002698',\n",
" '1030002699',\n",
" '1030002701',\n",
" '1030002702',\n",
" '1030002708',\n",
" '1030002714',\n",
" '1030002715',\n",
" '1030002716',\n",
" '1030002717',\n",
" '1030002718',\n",
" '1030002721',\n",
" '1030002722',\n",
" '1030002723',\n",
" '1030002725',\n",
" '1030002726',\n",
" '1030002728',\n",
" '1030002729',\n",
" '1030002738',\n",
" '1030002739',\n",
" '1030002770',\n",
" '1030002773',\n",
" '1030002784',\n",
" '1030002785',\n",
" '1030002786',\n",
" '1030002796',\n",
" '1030002798',\n",
" '1030002800',\n",
" '1030002810',\n",
" '1030002811',\n",
" '1030002813',\n",
" '1030002814',\n",
" '1030002823',\n",
" '1030002824',\n",
" '1030002838',\n",
" '1030002839',\n",
" '1030002842',\n",
" '1030002843',\n",
" '1030002861',\n",
" '1030002873',\n",
" '1030002882',\n",
" '1030002888',\n",
" '1030002889',\n",
" '1030002892',\n",
" '1030002893',\n",
" '1030002894',\n",
" '1030002895',\n",
" '1030002896',\n",
" '1030002897',\n",
" '1030002901',\n",
" '1030002911',\n",
" '1030002919',\n",
" '1030002931',\n",
" '1030002932',\n",
" '1030002933',\n",
" '1030002934',\n",
" '1030002942',\n",
" '1030002943',\n",
" '1030002961',\n",
" '1030002962',\n",
" '1030002963',\n",
" '1030002968',\n",
" '1030003614',\n",
" '1030003615',\n",
" '1030003858',\n",
" '1030003859',\n",
" '1030003865',\n",
" '1030003880',\n",
" '1030003882',\n",
" '1030003894',\n",
" '1030003897',\n",
" '1030003898',\n",
" '1030003905',\n",
" '1030003906',\n",
" '1030003918',\n",
" '1030003932',\n",
" '1030003933',\n",
" '1030003940',\n",
" '1030003942',\n",
" '1030003943',\n",
" '1030003948',\n",
" '1030003949',\n",
" '1030003956',\n",
" '1030003957',\n",
" '1030003965',\n",
" '1030003966',\n",
" '1030003968',\n",
" '1030003971',\n",
" '1030003984',\n",
" '1030003995',\n",
" '1030004001',\n",
" '1030004002',\n",
" '1030004003',\n",
" '1030004005',\n",
" '1030004006',\n",
" '1030004018',\n",
" '1030004019',\n",
" '1030004027',\n",
" '1030004028',\n",
" '1030004033',\n",
" '1030004034',\n",
" '1030004035',\n",
" '1030004036',\n",
" '1030004038',\n",
" '1030004041',\n",
" '1030004042',\n",
" '1030004050',\n",
" '1030004051',\n",
" '1030004075',\n",
" '1030004076',\n",
" '1030004084',\n",
" '1030004090',\n",
" '1030004091',\n",
" '1030004093',\n",
" '1030004094',\n",
" '1030004099',\n",
" '1030004100',\n",
" '1030004103',\n",
" '1030004105',\n",
" '1030004108',\n",
" '1030004109',\n",
" '1030004110',\n",
" '1030004111',\n",
" '1030004112',\n",
" '1030004113',\n",
" '1030004118',\n",
" '1030004119',\n",
" '1030004149',\n",
" '1030004150',\n",
" '1030004159',\n",
" '1030004160',\n",
" '1030004182',\n",
" '1030004183',\n",
" '1030004187',\n",
" '1030004188',\n",
" '1030004203',\n",
" '1030004205',\n",
" '1030004206',\n",
" '1030004213',\n",
" '1030004214',\n",
" '1030004235',\n",
" '1030004236',\n",
" '1030004245',\n",
" '1030004250',\n",
" '1030004251',\n",
" '1030004253',\n",
" '1030004254',\n",
" '1030004263',\n",
" '1030004270',\n",
" '1030004271',\n",
" '1030004273',\n",
" '1030004274',\n",
" '1030004275',\n",
" '1030004298',\n",
" '1030004299',\n",
" '1030004316',\n",
" '1030004325',\n",
" '1030004330',\n",
" '1030004331',\n",
" '1030004332',\n",
" '1030004344',\n",
" '1030004345',\n",
" '1030004346',\n",
" '1030004348',\n",
" '1030004368',\n",
" '1030004369',\n",
" '1030004370',\n",
" '1030004373',\n",
" '1030004383',\n",
" '1030004384',\n",
" '1030004408',\n",
" '1030004409',\n",
" '1030004421',\n",
" '1030004422',\n",
" '1030004441',\n",
" '1030004457',\n",
" '1030004504',\n",
" '1030004570',\n",
" '1030004573',\n",
" '1030004574',\n",
" '1030004632',\n",
" '1030004683',\n",
" '1030004684',\n",
" '1030004820',\n",
" '1030004821',\n",
" '1030004934',\n",
" '1030005006',\n",
" '1030005010',\n",
" '1030005058',\n",
" '1030005059',\n",
" '1030005060',\n",
" '1030005205',\n",
" '1030005206',\n",
" '1030005293',\n",
" '1030005345',\n",
" '1030005346',\n",
" '1030005384',\n",
" '1030005397',\n",
" '1030005443',\n",
" '1030005511',\n",
" '1030005512',\n",
" '1030005516',\n",
" '1030005517',\n",
" '1030005525',\n",
" '1030005528',\n",
" '1030005544',\n",
" '1030005567',\n",
" '1030005568',\n",
" '1030005579',\n",
" '1030005580',\n",
" '1030005581',\n",
" '1030005582',\n",
" '1030005585',\n",
" '1030005586',\n",
" '1030005588',\n",
" '1030005589',\n",
" '1030005597',\n",
" '1030005598',\n",
" '1030005601',\n",
" '1030005609',\n",
" '1030005612',\n",
" '1030005614',\n",
" '1030005624',\n",
" '1030005646',\n",
" '1030005654',\n",
" '1030005655',\n",
" '1030005657',\n",
" '1030005658',\n",
" '1030005660',\n",
" '1030005661',\n",
" '1030005667',\n",
" '1030005677',\n",
" '1030005690',\n",
" '1030005700',\n",
" '1030005703',\n",
" '1030005704',\n",
" '1030005710',\n",
" '1030005714',\n",
" '1030005715',\n",
" '1030005716',\n",
" '1030005720',\n",
" '1030005722',\n",
" '1030005727',\n",
" '1030005731',\n",
" '1030005732',\n",
" '1030005753',\n",
" '1030005755',\n",
" '1030005756',\n",
" '1030005757',\n",
" '1030005772',\n",
" '1030005775',\n",
" '1030005784',\n",
" '1030005785',\n",
" '1030005831',\n",
" '1030005832',\n",
" '1030005870',\n",
" '1030005877',\n",
" '1030005896',\n",
" '1030005930',\n",
" '1030005931',\n",
" '1030005933',\n",
" '1030005942',\n",
" '1030005944',\n",
" '1030005954',\n",
" '1030005959',\n",
" '1030005960',\n",
" '1030005966',\n",
" '1030005974',\n",
" '1030005979',\n",
" '1030005991',\n",
" '1030006004',\n",
" '1030006006',\n",
" '1030006012',\n",
" '1030006031',\n",
" '1030006032',\n",
" '1030006037',\n",
" '1030006052',\n",
" '1030006054',\n",
" '1030006055',\n",
" '1030006075',\n",
" '1030006076',\n",
" '1030006087',\n",
" '1030006093',\n",
" '1030006094',\n",
" '1030006098',\n",
" '1030006099',\n",
" '1030006108',\n",
" '1030006109',\n",
" '1030006126',\n",
" '1030006127',\n",
" '1030006129',\n",
" ...]"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sec_codes"
]
},
{
......@@ -353,7 +1374,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 10,
"id": "1985799f-9a72-4f53-a09b-e15c738f211f",
"metadata": {},
"outputs": [],
......@@ -390,7 +1411,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 11,
"id": "992ce6ba-b2eb-4e11-b025-53bd78366ff0",
"metadata": {},
"outputs": [
......@@ -398,7 +1419,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wall time: 7.81 s\n"
"Wall time: 5.99 s\n"
]
}
],
......@@ -410,7 +1431,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 18,
"id": "514f4c0b-bd1e-430b-9c5a-721bec381dc0",
"metadata": {},
"outputs": [
......@@ -418,9 +1439,32 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Wall time: 6.12 s\n"
"Wall time: 2.66 s\n"
]
}
],
"source": [
"%%time\n",
"\n",
"create_bond_fund_info(\"20211111\").groupby( \"债券型(子类)\").count()"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "13e11363-2e24-4a74-bd09-7b83669d4acd",
"metadata": {},
"outputs": [],
"source": [
"ddf = create_bond_fund_info(\"20211111\")"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "6c02fcff-7019-47f4-86e3-637939c9bb39",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
......@@ -457,177 +1501,274 @@
" <th>BDRTO</th>\n",
" <th>EQUITYINVERTO</th>\n",
" <th>CONVBDRTO_TO_BDRTO</th>\n",
" </tr>\n",
" <tr>\n",
" <th>债券型(子类)</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>中长期纯债型基金</th>\n",
" <td>655</td>\n",
" <td>655</td>\n",
" <td>465</td>\n",
" <td>655</td>\n",
" <td>655</td>\n",
" <td>655</td>\n",
" <td>655</td>\n",
" <td>655</td>\n",
" <td>655</td>\n",
" <td>655</td>\n",
" <td>655</td>\n",
" <td>655</td>\n",
" <td>639</td>\n",
" <td>633</td>\n",
" <td>626</td>\n",
" <th>0</th>\n",
" <td>1030000011</td>\n",
" <td>华夏债券投资基金</td>\n",
" <td>华夏债券</td>\n",
" <td>001001</td>\n",
" <td>证券投资基金</td>\n",
" <td>收益型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.2</td>\n",
" <td>普通债券型基金</td>\n",
" <td>3.2.1</td>\n",
" <td>普通债券型基金(一级A类)</td>\n",
" <td>110.27</td>\n",
" <td>6.195000e+00</td>\n",
" <td>3.610785e+01</td>\n",
" <td>可投股票型债券基金</td>\n",
" </tr>\n",
" <tr>\n",
" <th>可投股票型债券基金</th>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>321</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <td>370</td>\n",
" <th>1</th>\n",
" <td>1030000012</td>\n",
" <td>华夏债券投资基金</td>\n",
" <td>华夏债券</td>\n",
" <td>001003</td>\n",
" <td>证券投资基金</td>\n",
" <td>收益型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.2</td>\n",
" <td>普通债券型基金</td>\n",
" <td>3.2.2</td>\n",
" <td>普通债券型基金(一级B/C类)</td>\n",
" <td>90.79</td>\n",
" <td>6.250000e+00</td>\n",
" <td>3.012725e+01</td>\n",
" <td>可投股票型债券基金</td>\n",
" </tr>\n",
" <tr>\n",
" <th>可投转债型债券基金</th>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>77</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <td>87</td>\n",
" <th>2</th>\n",
" <td>1030000014</td>\n",
" <td>华夏希望债券型证券投资基金</td>\n",
" <td>华夏希望债券</td>\n",
" <td>001011</td>\n",
" <td>证券投资基金</td>\n",
" <td>收益型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.2</td>\n",
" <td>普通债券型基金</td>\n",
" <td>3.2.3</td>\n",
" <td>普通债券型基金(二级A类)</td>\n",
" <td>87.45</td>\n",
" <td>6.267500e+00</td>\n",
" <td>2.437650e+00</td>\n",
" <td>可投股票型债券基金</td>\n",
" </tr>\n",
" <tr>\n",
" <th>可转债基金</th>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>36</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <td>41</td>\n",
" <th>3</th>\n",
" <td>1030000015</td>\n",
" <td>华夏希望债券型证券投资基金</td>\n",
" <td>华夏希望债券</td>\n",
" <td>001013</td>\n",
" <td>证券投资基金</td>\n",
" <td>收益型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.2</td>\n",
" <td>普通债券型基金</td>\n",
" <td>3.2.4</td>\n",
" <td>普通债券型基金(二级B/C类)</td>\n",
" <td>84.83</td>\n",
" <td>1.151000e+01</td>\n",
" <td>1.630190e+00</td>\n",
" <td>可投股票型债券基金</td>\n",
" </tr>\n",
" <tr>\n",
" <th>短期纯债型基金</th>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>54</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>55</td>\n",
" <td>54</td>\n",
" <th>4</th>\n",
" <td>1030000022</td>\n",
" <td>国泰金龙债券证券投资基金</td>\n",
" <td>国泰金龙债券</td>\n",
" <td>020002</td>\n",
" <td>证券投资基金</td>\n",
" <td>收益型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.2</td>\n",
" <td>普通债券型基金</td>\n",
" <td>3.2.1</td>\n",
" <td>普通债券型基金(一级A类)</td>\n",
" <td>105.18</td>\n",
" <td>0.000000e+00</td>\n",
" <td>1.218145e+01</td>\n",
" <td>可投转债型债券基金</td>\n",
" </tr>\n",
" <tr>\n",
" <th>被动指数型债券基金</th>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>11</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <td>17</td>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1220</th>\n",
" <td>1030002083</td>\n",
" <td>交银施罗德理财60天债券型证券投资基金</td>\n",
" <td>交银理财60天债券</td>\n",
" <td>519722</td>\n",
" <td>证券投资基金</td>\n",
" <td>收益型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.6</td>\n",
" <td>短期理财债券型基金</td>\n",
" <td>3.6.2</td>\n",
" <td>短期理财债券型基金(B/C类)</td>\n",
" <td>85.64</td>\n",
" <td>1.776357e-15</td>\n",
" <td>7.105427e-15</td>\n",
" <td>短期纯债型基金</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1221</th>\n",
" <td>1030001814</td>\n",
" <td>易方达月月利理财债券型证券投资基金</td>\n",
" <td>易方达月月利理财债券</td>\n",
" <td>110050</td>\n",
" <td>证券投资基金</td>\n",
" <td>稳健成长型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.6</td>\n",
" <td>短期理财债券型基金</td>\n",
" <td>3.6.1</td>\n",
" <td>短期理财债券型基金(A类)</td>\n",
" <td>40.81</td>\n",
" <td>2.664535e-15</td>\n",
" <td>7.105427e-15</td>\n",
" <td>中长期纯债型基金</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1222</th>\n",
" <td>1030001815</td>\n",
" <td>易方达月月利理财债券型证券投资基金</td>\n",
" <td>易方达月月利理财债券</td>\n",
" <td>110051</td>\n",
" <td>证券投资基金</td>\n",
" <td>稳健成长型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.6</td>\n",
" <td>短期理财债券型基金</td>\n",
" <td>3.6.2</td>\n",
" <td>短期理财债券型基金(B/C类)</td>\n",
" <td>49.96</td>\n",
" <td>2.664535e-15</td>\n",
" <td>7.105427e-15</td>\n",
" <td>中长期纯债型基金</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1223</th>\n",
" <td>1030010003</td>\n",
" <td>易方达掌柜季季盈理财债券型证券投资基金</td>\n",
" <td>易方达掌柜季季盈理财债券</td>\n",
" <td>000833</td>\n",
" <td>证券投资基金</td>\n",
" <td>收益型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.6</td>\n",
" <td>短期理财债券型基金</td>\n",
" <td>3.6.1</td>\n",
" <td>短期理财债券型基金(A类)</td>\n",
" <td>49.46</td>\n",
" <td>3.552714e-15</td>\n",
" <td>2.842171e-14</td>\n",
" <td>中长期纯债型基金</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1224</th>\n",
" <td>1030002674</td>\n",
" <td>农银汇理14天理财债券型证券投资基金</td>\n",
" <td>农银14天理财债券</td>\n",
" <td>000322</td>\n",
" <td>证券投资基金</td>\n",
" <td>收益型</td>\n",
" <td>3</td>\n",
" <td>债券基金</td>\n",
" <td>3.6</td>\n",
" <td>短期理财债券型基金</td>\n",
" <td>3.6.1</td>\n",
" <td>短期理财债券型基金(A类)</td>\n",
" <td>86.78</td>\n",
" <td>3.552714e-15</td>\n",
" <td>1.776357e-14</td>\n",
" <td>短期纯债型基金</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1225 rows × 16 columns</p>\n",
"</div>"
],
"text/plain": [
" SECURITYID FDNAME SNAMECOMP FSYMBOL FDNATURE INVESTSTYLE \\\n",
"债券型(子类) \n",
"中长期纯债型基金 655 655 465 655 655 655 \n",
"可投股票型债券基金 370 370 321 370 370 370 \n",
"可投转债型债券基金 87 87 77 87 87 87 \n",
"可转债基金 41 41 36 41 41 41 \n",
"短期纯债型基金 55 55 54 55 55 55 \n",
"被动指数型债券基金 17 17 11 17 17 17 \n",
" SECURITYID FDNAME SNAMECOMP FSYMBOL FDNATURE \\\n",
"0 1030000011 华夏债券投资基金 华夏债券 001001 证券投资基金 \n",
"1 1030000012 华夏债券投资基金 华夏债券 001003 证券投资基金 \n",
"2 1030000014 华夏希望债券型证券投资基金 华夏希望债券 001011 证券投资基金 \n",
"3 1030000015 华夏希望债券型证券投资基金 华夏希望债券 001013 证券投资基金 \n",
"4 1030000022 国泰金龙债券证券投资基金 国泰金龙债券 020002 证券投资基金 \n",
"... ... ... ... ... ... \n",
"1220 1030002083 交银施罗德理财60天债券型证券投资基金 交银理财60天债券 519722 证券投资基金 \n",
"1221 1030001814 易方达月月利理财债券型证券投资基金 易方达月月利理财债券 110050 证券投资基金 \n",
"1222 1030001815 易方达月月利理财债券型证券投资基金 易方达月月利理财债券 110051 证券投资基金 \n",
"1223 1030010003 易方达掌柜季季盈理财债券型证券投资基金 易方达掌柜季季盈理财债券 000833 证券投资基金 \n",
"1224 1030002674 农银汇理14天理财债券型证券投资基金 农银14天理财债券 000322 证券投资基金 \n",
"\n",
" L1CODE L1NAME L2CODE L2NAME L3CODE L3NAME BDRTO \\\n",
"债券型(子类) \n",
"中长期纯债型基金 655 655 655 655 655 655 639 \n",
"可投股票型债券基金 370 370 370 370 370 370 370 \n",
"可投转债型债券基金 87 87 87 87 87 87 87 \n",
"可转债基金 41 41 41 41 41 41 41 \n",
"短期纯债型基金 55 55 55 55 55 55 55 \n",
"被动指数型债券基金 17 17 17 17 17 17 17 \n",
" INVESTSTYLE L1CODE L1NAME L2CODE L2NAME L3CODE L3NAME \\\n",
"0 收益型 3 债券基金 3.2 普通债券型基金 3.2.1 普通债券型基金(一级A类) \n",
"1 收益型 3 债券基金 3.2 普通债券型基金 3.2.2 普通债券型基金(一级B/C类) \n",
"2 收益型 3 债券基金 3.2 普通债券型基金 3.2.3 普通债券型基金(二级A类) \n",
"3 收益型 3 债券基金 3.2 普通债券型基金 3.2.4 普通债券型基金(二级B/C类) \n",
"4 收益型 3 债券基金 3.2 普通债券型基金 3.2.1 普通债券型基金(一级A类) \n",
"... ... ... ... ... ... ... ... \n",
"1220 收益型 3 债券基金 3.6 短期理财债券型基金 3.6.2 短期理财债券型基金(B/C类) \n",
"1221 稳健成长型 3 债券基金 3.6 短期理财债券型基金 3.6.1 短期理财债券型基金(A类) \n",
"1222 稳健成长型 3 债券基金 3.6 短期理财债券型基金 3.6.2 短期理财债券型基金(B/C类) \n",
"1223 收益型 3 债券基金 3.6 短期理财债券型基金 3.6.1 短期理财债券型基金(A类) \n",
"1224 收益型 3 债券基金 3.6 短期理财债券型基金 3.6.1 短期理财债券型基金(A类) \n",
"\n",
" EQUITYINVERTO CONVBDRTO_TO_BDRTO \n",
"债券型(子类) \n",
"中长期纯债型基金 633 626 \n",
"可投股票型债券基金 370 370 \n",
"可投转债型债券基金 87 87 \n",
"可转债基金 41 41 \n",
"短期纯债型基金 55 54 \n",
"被动指数型债券基金 17 17 "
" BDRTO EQUITYINVERTO CONVBDRTO_TO_BDRTO 债券型(子类) \n",
"0 110.27 6.195000e+00 3.610785e+01 可投股票型债券基金 \n",
"1 90.79 6.250000e+00 3.012725e+01 可投股票型债券基金 \n",
"2 87.45 6.267500e+00 2.437650e+00 可投股票型债券基金 \n",
"3 84.83 1.151000e+01 1.630190e+00 可投股票型债券基金 \n",
"4 105.18 0.000000e+00 1.218145e+01 可投转债型债券基金 \n",
"... ... ... ... ... \n",
"1220 85.64 1.776357e-15 7.105427e-15 短期纯债型基金 \n",
"1221 40.81 2.664535e-15 7.105427e-15 中长期纯债型基金 \n",
"1222 49.96 2.664535e-15 7.105427e-15 中长期纯债型基金 \n",
"1223 49.46 3.552714e-15 2.842171e-14 中长期纯债型基金 \n",
"1224 86.78 3.552714e-15 1.776357e-14 短期纯债型基金 \n",
"\n",
"[1225 rows x 16 columns]"
]
},
"execution_count": 32,
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%%time\n",
"\n",
"create_bond_fund_info(\"20211111\").groupby( \"债券型(子类)\").count()"
"ddf"
]
},
{
......@@ -641,7 +1782,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 13,
"id": "bc46497a-3044-4455-b427-5e461acffc71",
"metadata": {},
"outputs": [],
......@@ -659,7 +1800,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 14,
"id": "4555a339-5ad5-4158-81a0-4011ab35d755",
"metadata": {},
"outputs": [
......@@ -717,7 +1858,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 15,
"id": "f1f60b62-c7c8-4295-9b3c-4fbbc7bc26bd",
"metadata": {},
"outputs": [],
......@@ -728,7 +1869,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 16,
"id": "0c53a5ad-430e-459a-b8cf-13ab69b5e3f4",
"metadata": {},
"outputs": [
......@@ -773,165 +1914,165 @@
" <tbody>\n",
" <tr>\n",
" <th>20150430</th>\n",
" <td>0.044518</td>\n",
" <td>0.074199</td>\n",
" <td>0.030098</td>\n",
" <td>0.177746</td>\n",
" <td>0.035524</td>\n",
" <td>0.073317</td>\n",
" <td>0.046774</td>\n",
" <td>0.181991</td>\n",
" <td>NaN</td>\n",
" <td>0.018172</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20150731</th>\n",
" <td>0.018413</td>\n",
" <td>-0.001703</td>\n",
" <td>0.012489</td>\n",
" <td>-0.168559</td>\n",
" <td>0.015343</td>\n",
" <td>0.003398</td>\n",
" <td>0.009793</td>\n",
" <td>-0.181767</td>\n",
" <td>NaN</td>\n",
" <td>0.001508</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20151030</th>\n",
" <td>0.019671</td>\n",
" <td>0.017910</td>\n",
" <td>0.022858</td>\n",
" <td>0.001486</td>\n",
" <td>0.019825</td>\n",
" <td>0.017772</td>\n",
" <td>0.022953</td>\n",
" <td>0.003363</td>\n",
" <td>NaN</td>\n",
" <td>0.023154</td>\n",
" <td>0.023572</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20160129</th>\n",
" <td>0.005979</td>\n",
" <td>-0.010265</td>\n",
" <td>0.013286</td>\n",
" <td>-0.132160</td>\n",
" <td>0.007451</td>\n",
" <td>-0.011741</td>\n",
" <td>0.008906</td>\n",
" <td>-0.123049</td>\n",
" <td>NaN</td>\n",
" <td>0.016452</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20160429</th>\n",
" <td>0.001132</td>\n",
" <td>0.006828</td>\n",
" <td>0.000991</td>\n",
" <td>-0.011851</td>\n",
" <td>0.000934</td>\n",
" <td>0.006463</td>\n",
" <td>0.001271</td>\n",
" <td>-0.014195</td>\n",
" <td>NaN</td>\n",
" <td>-0.000176</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20160729</th>\n",
" <td>0.020778</td>\n",
" <td>0.020762</td>\n",
" <td>0.021270</td>\n",
" <td>-0.009703</td>\n",
" <td>0.020894</td>\n",
" <td>0.021145</td>\n",
" <td>0.019743</td>\n",
" <td>-0.011719</td>\n",
" <td>NaN</td>\n",
" <td>0.020802</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20161031</th>\n",
" <td>0.012197</td>\n",
" <td>0.015085</td>\n",
" <td>0.015368</td>\n",
" <td>0.041360</td>\n",
" <td>0.011858</td>\n",
" <td>0.016069</td>\n",
" <td>0.015851</td>\n",
" <td>0.043448</td>\n",
" <td>NaN</td>\n",
" <td>0.010548</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20170126</th>\n",
" <td>-0.018752</td>\n",
" <td>-0.021641</td>\n",
" <td>-0.018342</td>\n",
" <td>-0.059164</td>\n",
" <td>-0.019690</td>\n",
" <td>-0.020954</td>\n",
" <td>-0.020338</td>\n",
" <td>-0.060613</td>\n",
" <td>NaN</td>\n",
" <td>-0.022313</td>\n",
" <td>-0.023250</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20170428</th>\n",
" <td>-0.003381</td>\n",
" <td>-0.002405</td>\n",
" <td>-0.006429</td>\n",
" <td>-0.020709</td>\n",
" <td>-0.002897</td>\n",
" <td>-0.002623</td>\n",
" <td>-0.003590</td>\n",
" <td>-0.024449</td>\n",
" <td>NaN</td>\n",
" <td>-0.006358</td>\n",
" <td>-0.007383</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20170731</th>\n",
" <td>0.011900</td>\n",
" <td>0.019261</td>\n",
" <td>0.015828</td>\n",
" <td>0.060818</td>\n",
" <td>0.012685</td>\n",
" <td>0.019675</td>\n",
" <td>0.015882</td>\n",
" <td>0.057182</td>\n",
" <td>NaN</td>\n",
" <td>0.006517</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20171031</th>\n",
" <td>0.002705</td>\n",
" <td>0.007025</td>\n",
" <td>0.001217</td>\n",
" <td>-0.030152</td>\n",
" <td>0.002595</td>\n",
" <td>0.006664</td>\n",
" <td>0.001133</td>\n",
" <td>-0.025014</td>\n",
" <td>NaN</td>\n",
" <td>-0.003102</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20180131</th>\n",
" <td>0.005168</td>\n",
" <td>0.002382</td>\n",
" <td>0.003739</td>\n",
" <td>-0.019119</td>\n",
" <td>0.005173</td>\n",
" <td>0.002649</td>\n",
" <td>0.002917</td>\n",
" <td>-0.021521</td>\n",
" <td>NaN</td>\n",
" <td>-0.000095</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20180427</th>\n",
" <td>0.013015</td>\n",
" <td>-0.003674</td>\n",
" <td>0.013525</td>\n",
" <td>-0.048516</td>\n",
" <td>0.012661</td>\n",
" <td>-0.003772</td>\n",
" <td>0.012321</td>\n",
" <td>-0.045589</td>\n",
" <td>NaN</td>\n",
" <td>0.021583</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20180731</th>\n",
" <td>0.013745</td>\n",
" <td>0.000297</td>\n",
" <td>0.006004</td>\n",
" <td>-0.035198</td>\n",
" <td>0.013688</td>\n",
" <td>0.000307</td>\n",
" <td>0.004361</td>\n",
" <td>-0.034723</td>\n",
" <td>NaN</td>\n",
" <td>0.013743</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20181031</th>\n",
" <td>0.009432</td>\n",
" <td>-0.011770</td>\n",
" <td>0.001575</td>\n",
" <td>-0.038546</td>\n",
" <td>0.009671</td>\n",
" <td>-0.012920</td>\n",
" <td>0.003667</td>\n",
" <td>-0.037837</td>\n",
" <td>NaN</td>\n",
" <td>0.006395</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20190131</th>\n",
" <td>0.020851</td>\n",
" <td>0.019317</td>\n",
" <td>0.022969</td>\n",
" <td>0.031067</td>\n",
" <td>0.021116</td>\n",
" <td>0.019420</td>\n",
" <td>0.021947</td>\n",
" <td>0.030910</td>\n",
" <td>NaN</td>\n",
" <td>0.023644</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20190430</th>\n",
" <td>0.004133</td>\n",
" <td>0.028246</td>\n",
" <td>0.011743</td>\n",
" <td>0.090447</td>\n",
" <td>0.004728</td>\n",
" <td>0.028806</td>\n",
" <td>0.012569</td>\n",
" <td>0.089306</td>\n",
" <td>NaN</td>\n",
" <td>-0.001468</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20190731</th>\n",
" <td>0.014170</td>\n",
" <td>0.011994</td>\n",
" <td>0.013378</td>\n",
" <td>0.009961</td>\n",
" <td>0.006186</td>\n",
" <td>0.018123</td>\n",
" <td>0.014535</td>\n",
" <td>0.011524</td>\n",
" <td>0.013471</td>\n",
" <td>0.009133</td>\n",
" <td>NaN</td>\n",
" <td>0.018044</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20191031</th>\n",
......@@ -1030,24 +2171,24 @@
"text/plain": [
"债券型(子类) 中长期纯债型基金 可投股票型债券基金 可投转债型债券基金 可转债基金 短期纯债型基金 被动指数型债券基金\n",
"level_0 \n",
"20150430 0.044518 0.074199 0.030098 0.177746 NaN 0.018172\n",
"20150731 0.018413 -0.001703 0.012489 -0.168559 NaN 0.001508\n",
"20151030 0.019671 0.017910 0.022858 0.001486 NaN 0.023154\n",
"20160129 0.005979 -0.010265 0.013286 -0.132160 NaN 0.016452\n",
"20160429 0.001132 0.006828 0.000991 -0.011851 NaN -0.000176\n",
"20160729 0.020778 0.020762 0.021270 -0.009703 NaN 0.020802\n",
"20161031 0.012197 0.015085 0.015368 0.041360 NaN 0.010548\n",
"20170126 -0.018752 -0.021641 -0.018342 -0.059164 NaN -0.022313\n",
"20170428 -0.003381 -0.002405 -0.006429 -0.020709 NaN -0.006358\n",
"20170731 0.011900 0.019261 0.015828 0.060818 NaN 0.006517\n",
"20171031 0.002705 0.007025 0.001217 -0.030152 NaN -0.003102\n",
"20180131 0.005168 0.002382 0.003739 -0.019119 NaN -0.000095\n",
"20180427 0.013015 -0.003674 0.013525 -0.048516 NaN 0.021583\n",
"20180731 0.013745 0.000297 0.006004 -0.035198 NaN 0.013743\n",
"20181031 0.009432 -0.011770 0.001575 -0.038546 NaN 0.006395\n",
"20190131 0.020851 0.019317 0.022969 0.031067 NaN 0.023644\n",
"20190430 0.004133 0.028246 0.011743 0.090447 NaN -0.001468\n",
"20190731 0.014170 0.011994 0.013378 0.009961 0.006186 0.018123\n",
"20150430 0.035524 0.073317 0.046774 0.181991 NaN 0.018172\n",
"20150731 0.015343 0.003398 0.009793 -0.181767 NaN 0.001508\n",
"20151030 0.019825 0.017772 0.022953 0.003363 NaN 0.023572\n",
"20160129 0.007451 -0.011741 0.008906 -0.123049 NaN 0.016452\n",
"20160429 0.000934 0.006463 0.001271 -0.014195 NaN -0.000176\n",
"20160729 0.020894 0.021145 0.019743 -0.011719 NaN 0.020802\n",
"20161031 0.011858 0.016069 0.015851 0.043448 NaN 0.010548\n",
"20170126 -0.019690 -0.020954 -0.020338 -0.060613 NaN -0.023250\n",
"20170428 -0.002897 -0.002623 -0.003590 -0.024449 NaN -0.007383\n",
"20170731 0.012685 0.019675 0.015882 0.057182 NaN 0.006517\n",
"20171031 0.002595 0.006664 0.001133 -0.025014 NaN -0.003102\n",
"20180131 0.005173 0.002649 0.002917 -0.021521 NaN -0.000095\n",
"20180427 0.012661 -0.003772 0.012321 -0.045589 NaN 0.021583\n",
"20180731 0.013688 0.000307 0.004361 -0.034723 NaN 0.013743\n",
"20181031 0.009671 -0.012920 0.003667 -0.037837 NaN 0.006395\n",
"20190131 0.021116 0.019420 0.021947 0.030910 NaN 0.023644\n",
"20190430 0.004728 0.028806 0.012569 0.089306 NaN -0.001468\n",
"20190731 0.014535 0.011524 0.013471 0.009133 NaN 0.018044\n",
"20191031 0.006190 0.010110 0.007836 0.021186 0.004760 0.002782\n",
"20200123 0.015694 0.033943 0.027278 0.085095 NaN 0.023261\n",
"20200430 0.027414 0.020150 0.025039 0.009367 0.017390 0.038860\n",
......@@ -1060,7 +2201,7 @@
"20211109 0.002107 0.004476 0.005760 0.019146 0.000679 0.004045"
]
},
"execution_count": 37,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
......@@ -1080,9 +2221,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:root] *",
"display_name": "Python 3",
"language": "python",
"name": "conda-root-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
......@@ -1094,7 +2235,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.8.10"
}
},
"nbformat": 4,
......
......@@ -24,27 +24,18 @@ def nearest_report_date(date):
return dt.date(last_year, q, last).strftime("%Y%m%d")
def fd_alive_funds(trade_dt, l1_code=None):
if l1_code is not None:
security_ids = read_sql(f"""
select SECURITYID from TQ_FD_TYPECLASS
def fd_alive_funds(trade_dt, type_style, class_code):
sec_codes = read_sql(f"""
select SECODE from TQ_FD_TYPE
WHERE
ISVALID = 1 AND
L1CODE = {l1_code} AND
TYPESTYLE = '{type_style}' AND
CLASSCODE = '{class_code}' AND
BEGINDATE <= '{trade_dt}' AND
(ENDDATE>='{trade_dt}' or ENDDATE = '19000101')
ORDER BY SECURITYID;
""")["SECURITYID"].unique().tolist()
else:
security_ids = read_sql(f"""
select SECURITYID from TQ_FD_TYPECLASS
WHERE
ISVALID = 1 AND
BEGINDATE <= '{trade_dt}' AND
(ENDDATE>='{trade_dt}' or ENDDATE = '19000101')
ORDER BY SECURITYID;
""")["SECURITYID"].unique().tolist()
return security_ids
ORDER BY SECODE;
""")["SECODE"].unique().tolist()
return sec_codes
def fd_basicinfo(security_ids=None, trade_dt=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment