Загрузить файлы в «/»
This commit is contained in:
commit
9b5f392f7f
2
comparison.py
Normal file
2
comparison.py
Normal file
@ -0,0 +1,2 @@
|
||||
def compare(z: str)->bool:
|
||||
return eval(z)
|
||||
5
count_sum_pandas.py
Normal file
5
count_sum_pandas.py
Normal 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
10
last_friday_datetime.py
Normal 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")
|
||||
Loading…
Reference in New Issue
Block a user