usage_df.py 文件源码

python
阅读 507 收藏 0 点赞 0 评论 0

项目:function-pipe 作者: InvestmentSystems 项目源码 文件源码
def approach_pipe_4b():

    a = (PN4.name_count_per_year(lambda n: n.lower().startswith('lesl'))
            | PN4.percent | fpn.store('lesl'))

    b = (PN4.name_count_per_year(lambda n: n.lower().startswith('dana'))
            | PN4.percent | fpn.store('dana'))

    f = (PN4.merge_gender_data(lesl=a, dana=b)
            | PN4.year_range(1920, 2000)
            | fpn.store('merged') * 100
            | PN4.plot('gender.png')
            | PN4.open_plot)

    pni = PN4.PNI('/tmp')
    f[pni]


    xlsx_fp = os.path.join(pni.output_dir, 'output.xlsx')
    xlsx = pd.ExcelWriter(xlsx_fp)
    for k, df in pni.store_items():
        df.to_excel(xlsx, k)
    xlsx.save()

    os.system('libreoffice --calc ' + xlsx_fp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号