Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gleasonw authored Jan 23, 2024
1 parent d791dd3 commit a094724
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,10 @@ def calc_ratio(row):

def get_unix_timestamp(row) -> int:
year = int(row.get("annee", 0))
month = int(row.get("mois", 0)) - 1 if row.get("mois") else 0
month = int(row.get("mois", 1))

dt = datetime(year, month + 1, 1) if month >= 0 else datetime(year, 1, 1)
return int((dt - datetime(1970, 1, 1)).total_seconds())
dt = datetime(year, month, 1)
return dt.timestamp()

data = series_dataframe.apply(
lambda row: (get_unix_timestamp(row), row["ratio"]), axis=1
Expand Down

0 comments on commit a094724

Please sign in to comment.