Compare commits

..

No commits in common. "d872cd768154cef22accf83385f5ed9773cdb5c5" and "e2805f9af2ce9b8d6e54d8637c334813e30ea335" have entirely different histories.

3 changed files with 8 additions and 10 deletions

View File

@ -46,7 +46,4 @@ clean_built:
clean_all: clean_built clean_raw clean_all: clean_built clean_raw
import_nextcloud: import_nextcloud:
rsync -av ~/Nextcloud/PLESNA\ Compta\ SYSTEM/Histoire/ ./datas/Histoire rsync -a ~/Nextcloud/PLESNA\ Compta\ SYSTEM/Histoire/ ./datas/Histoire
push_nextcloud:
rsync -av ./datas/datamart/ ~/Nextcloud/PLESNA\ Compta\ SYSTEM/DataMart

View File

@ -19,6 +19,9 @@ logger.setLevel(logging.DEBUG)
def build_lots(dfs: list[pd.DataFrame]) -> pd.DataFrame: def build_lots(dfs: list[pd.DataFrame]) -> pd.DataFrame:
df = pd.concat(dfs) df = pd.concat(dfs)
df = df.assign(
Impact=df["Crédit"] - df["Débit"],
)
return df return df

View File

@ -23,11 +23,9 @@ def extract_cat(cat: pd.DataFrame):
def lot_naming(value): def lot_naming(value):
try: if str(value).isnumeric():
v = int(value) return str(value).zfill(2)
except ValueError: return "PC"
return "PC"
return str(v).zfill(2)
def trans_2017_2021( def trans_2017_2021(
@ -101,7 +99,7 @@ def trans_2023(
df = df.assign( df = df.assign(
Débit=df["Débit"].fillna(0), Débit=df["Débit"].fillna(0),
Crédit=df["Crédit"].fillna(0), Crédit=df["Crédit"].fillna(0),
Lot=df["Porte"].apply(lot_naming), Lot=lot_naming(df["Porte"]),
Année=year, Année=year,
) )
return df[stagging_columns] return df[stagging_columns]