PythonDataScience24 / AirBnB-DataScienceProject

GNU General Public License v3.0
2 stars 0 forks source link

Refactor code b/c of DataPreprocessor #19

Closed bdravec closed 4 months ago

bdravec commented 4 months ago

WAIT with REFACTORING

availability.py def clean_data(self) -> pd.DataFrame: """Cleans the price and service fees columns. NaN values in price are dropped, in service fee are assumed to be 0. The price and service fee columns are converted from Strings to integers. Has to be called before the first method which calculates min or max prices is called.""" self.df.dropna(subset=['availability 365'], inplace=True) self.df.loc[self.df["availability 365"] > 365, "availability 365"] = 365 self.df.loc[self.df["availability 365"] < 0, "availability 365"] = 0 return self.df