api 1.6
This commit is contained in:
@@ -14,7 +14,6 @@ def report_date(df, date_format: str):
|
||||
return dt.strftime(date_format)
|
||||
def process_sheet(df, real_arti:int, real_quantity:int, real_sum_1:int):
|
||||
df = df.iloc[2:].reset_index(drop=True)
|
||||
|
||||
# выбор нужных столбцов ПО ПОЗИЦИИ
|
||||
df = df.iloc[:, [real_arti, real_quantity, real_sum_1]].copy().dropna()
|
||||
df = df[(df != 0).all(axis=1)]
|
||||
@@ -29,6 +28,7 @@ def process_sheet(df, real_arti:int, real_quantity:int, real_sum_1:int):
|
||||
df['counts'] = df['counts'].astype(int)
|
||||
|
||||
#Группировка
|
||||
df = df.groupby('arti', as_index=False).agg({'counts': 'sum', 'price': 'sum'}) #groupping
|
||||
df = processing(df) #vlookup for ref_keys
|
||||
validated_rows, errors = [], []
|
||||
for i, row in df.iterrows():
|
||||
@@ -43,6 +43,6 @@ def process_sheet(df, real_arti:int, real_quantity:int, real_sum_1:int):
|
||||
)
|
||||
return validated_rows
|
||||
def evaluating(dfs):
|
||||
validated_rows_1 = process_sheet(dfs["Отчет о выкупленных товарах"], real_arti=3,real_quantity=10, real_sum_1=11) # номера столбцов от озона
|
||||
date=report_date(dfs["Отчет о выкупленных товарах"], date_format=settings.TIMEFORMAT)
|
||||
validated_rows_1 = process_sheet(dfs["Отчёт о выкупленных товарах"], real_arti=3,real_quantity=10, real_sum_1=11) # номера столбцов от озона
|
||||
date=report_date(dfs["Отчёт о выкупленных товарах"], date_format=settings.TIMEFORMAT)
|
||||
return validated_rows_1, date
|
||||
Reference in New Issue
Block a user