-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8899d6
commit c0cf427
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
import polars as pl | ||
import polars.selectors as cs | ||
from pypmsi.mco.vvs.vvs_mco_libelles_valo import vvs_mco_libelles_valo | ||
|
||
def vvs_mco_epmsi_sv(vvs_df): | ||
|
||
return ( | ||
vvs_df | ||
.group_by('type_fin') | ||
.agg(pl.col('cle_rsa').count().alias('nb_rsa'), | ||
pl.col('rec_totale').sum().round(2).alias('recette_br_avec_coeffs')) | ||
.sort('type_fin') | ||
.join(vvs_mco_libelles_valo()['vvs_mco_lib_type_sej'], on = 'type_fin', how = 'left') | ||
) | ||
|
||
|
||
def vvs_mco_epmsi_rav(vvs_df): | ||
|
||
return ( | ||
vvs_df | ||
.select(cs.starts_with('rec')) | ||
.sum() | ||
.melt(variable_name = 'rubrique', value_name = 'recette') | ||
.join(vvs_mco_libelles_valo()['vvs_mco_lib_valo'], on = 'rubrique', how = 'left') | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "pypmsi" | ||
version = "0.1.9" | ||
version = "0.2.0" | ||
description = "parser for french PMSI files in python / pola.rs" | ||
authors = ["GuillaumePressiat <[email protected]>"] | ||
license = "AGPL3" | ||
|