Feat: formatage des numéros de lot en 2digits
This commit is contained in:
parent
bde6a0dfc6
commit
882974cee6
@ -7,7 +7,7 @@ def parse_above_loc(content):
|
|||||||
row = {}
|
row = {}
|
||||||
app, loc, *_ = content.split("\n")
|
app, loc, *_ = content.split("\n")
|
||||||
app_ = app.split(" ")
|
app_ = app.split(" ")
|
||||||
row["lot"] = app_[1]
|
row["lot"] = f"{int(app_[1]):02d}"
|
||||||
row["type"] = " ".join(app_[2:])
|
row["type"] = " ".join(app_[2:])
|
||||||
row["locataire"] = loc
|
row["locataire"] = loc
|
||||||
return pd.Series(row)
|
return pd.Series(row)
|
||||||
|
@ -73,7 +73,9 @@ def join(src, dest):
|
|||||||
}
|
}
|
||||||
for file in p.glob("*.xlsx"):
|
for file in p.glob("*.xlsx"):
|
||||||
year, month, immeuble, table = file.stem.split("_")
|
year, month, immeuble, table = file.stem.split("_")
|
||||||
df = pd.read_excel(file).assign(annee=year, mois=month, immeuble=immeuble[:3])
|
df = pd.read_excel(file, dtype={"lot": str}).assign(
|
||||||
|
annee=year, mois=month, immeuble=immeuble[:3]
|
||||||
|
)
|
||||||
dfs[table].append(df)
|
dfs[table].append(df)
|
||||||
for tablename, datas in dfs.items():
|
for tablename, datas in dfs.items():
|
||||||
df = pd.concat(datas)
|
df = pd.concat(datas)
|
||||||
|
Loading…
Reference in New Issue
Block a user