Reza-galaxy21 commited on
Commit
e38cf15
·
verified ·
1 Parent(s): 8f81d29

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +3 -3
utils.py CHANGED
@@ -24,8 +24,8 @@ def parse_excel_file(file_path):
24
  materials = []
25
  for _, row in df.iterrows():
26
  try:
27
- quantity = row[resolved_columns["تعداد"]]
28
- if pd.isna(quantity) or float(quantity) <= 0:
29
  continue
30
  except:
31
  continue
@@ -33,7 +33,7 @@ def parse_excel_file(file_path):
33
  material = {
34
  "code": str(row[resolved_columns["کد"]]).strip(),
35
  "description": str(row[resolved_columns["عنوان"]]).strip(),
36
- "quantity": float(quantity),
37
  "unit": str(row[resolved_columns["واحد"]]).strip()
38
  }
39
  materials.append(material)
 
24
  materials = []
25
  for _, row in df.iterrows():
26
  try:
27
+ quantity = float(row[resolved_columns["تعداد"]])
28
+ if pd.isna(quantity) or quantity <= 0:
29
  continue
30
  except:
31
  continue
 
33
  material = {
34
  "code": str(row[resolved_columns["کد"]]).strip(),
35
  "description": str(row[resolved_columns["عنوان"]]).strip(),
36
+ "quantity": quantity,
37
  "unit": str(row[resolved_columns["واحد"]]).strip()
38
  }
39
  materials.append(material)