Загрузить файлы в «/»

This commit is contained in:
Сухоруков 2026-01-31 17:20:37 +00:00
commit 9b5f392f7f
3 changed files with 17 additions and 0 deletions

2
comparison.py Normal file
View File

@ -0,0 +1,2 @@
def compare(z: str)->bool:
return eval(z)

5
count_sum_pandas.py Normal file
View File

@ -0,0 +1,5 @@
import pandas as pd
def count_sum(df: pd.DataFrame)->pd.DataFrame:
return df.groupby('Товар')['Количество'].sum().to_frame()

10
last_friday_datetime.py Normal file
View File

@ -0,0 +1,10 @@
from datetime import datetime, timedelta
import calendar
def get_last_friday(month_year: str) -> str:
month, year = map(int, month_year.split('/'))
last_day = calendar.monthrange(year, month)[1]
date_obj = datetime(year, month, last_day)
offset = (date_obj.weekday() - 4) % 7
last_friday = date_obj - timedelta(days=offset)
return last_friday.strftime("%d.%m.%Y")