免疫史计算

 vaccine_history = (

    person.select('id_x').unique()
    .join(
        vaccine_tbl
        .filter(pl.col('大类编码').cast(pl.UInt32) < 20)
        .select('vaccine_name')
        .unique()
        .filter(pl.col('vaccine_name').is_not_null()),
        how='cross'
    )
    .join(
        person
        .group_by(['id_x', 'vaccine_name'])
        .agg(pl.col('id_x').len().alias('剂次数')),
        on=['id_x', 'vaccine_name'],
        how='left'
    )
    .with_columns(pl.col('剂次数').fill_null(0))
    .sort(['id_x', 'vaccine_name'])
)

评论

此博客中的热门博文

V2ray websocket(ws)+tls+nginx分流

Rstudio 使用代理