Skip to content

Commit

Permalink
Update scrape.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sakan811 authored Jun 16, 2024
1 parent f0d609c commit be7757a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions japan_avg_hotel_price_finder/scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ def transform_data(df: pd.DataFrame) -> pd.DataFrame:
logger.info("Transforming data...")

# Remove duplicate rows from the DataFrame based on 'Hotel' column
df_dropped = df.drop_duplicates(subset='Hotel')

# Create a copy of the relevant columns
df_filtered = df_dropped[['Price', 'Review']].copy()
df_filtered = df.drop_duplicates(subset='Hotel').copy()

# Convert columns to numeric values
df_filtered.loc[:, 'Price'] = pd.to_numeric(df_filtered['Price'], errors='coerce')
Expand Down

0 comments on commit be7757a

Please sign in to comment.