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

Update pages/2_Data_CLeaning_and_Preprocessing.py

Browse files
pages/2_Data_CLeaning_and_Preprocessing.py CHANGED
@@ -102,10 +102,10 @@ if uploaded_file is not None:
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:
 
102
  file_name="cleaned_dataset.csv",
103
  mime="text/csv"
104
  )
105
+ data = data.rename(columns={'ProductCategory': 'Category', 'ProductBrand': 'Brand', 'ProductPrice': 'Price'})
106
  # Correct Price Column values (round off to 2 decimal places)
107
+ data['Price'] = data['Price'].apply(lambda x: round(x,2))
108
+ print(data.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: