trohith89 commited on
Commit
5834d6a
·
verified ·
1 Parent(s): fd11498

Update pages/2_Data_CLeaning_and_Preprocessing.py

Browse files
pages/2_Data_CLeaning_and_Preprocessing.py CHANGED
@@ -102,7 +102,10 @@ if uploaded_file is not None:
102
  file_name="cleaned_dataset.csv",
103
  mime="text/csv"
104
  )
105
-
 
 
 
106
  except pd.errors.EmptyDataError:
107
  st.error("The uploaded CSV file is empty. Please upload a valid file.")
108
  except pd.errors.ParserError:
 
102
  file_name="cleaned_dataset.csv",
103
  mime="text/csv"
104
  )
105
+ df = df.rename(columns={'ProductCategory': 'Category', 'ProductBrand': 'Brand', 'ProductPrice': 'Price'})
106
+ # Correct Price Column values (round off to 2 decimal places)
107
+ df['Price'] = df['Price'].apply(lambda x: round(x,2))
108
+ print(df.head())
109
  except pd.errors.EmptyDataError:
110
  st.error("The uploaded CSV file is empty. Please upload a valid file.")
111
  except pd.errors.ParserError: