Question: When reading in the dataframe using the load csv function, one can see that it contains a lot of textual data which will not be
When reading in the dataframe using the load csv function, one can see that it contains a lot of textual data which will not be relevant for the numerical analyses in Part 1 and Part 2. Therefore, implement two functions drop cols and drop_cols na which remove some of the columns. Detailed instructions: [2 marks each] drop cols (df) : takes the dataframe as an input. It returns the reduced dataframe after dropping the following columns: N scrape_id, last_scraped', 'description", "listing_url' neighbourhood", 'calendar_last_ scraped amenities', 'neighborhood overview picture_url", "host_url": "host_about, hosti location hosttotal listings count host thumbnail url', 'host picture_url" host. verifications bathrooms text. Thas availability', 'minimum_minimum nights, maximum minimum nights minimum maximum nights maximum maximum nights minimum nights_avg_nem maximum nights avg_ntm number of reviews. 1300. calculated host_listings_count".cale ulated host listingsi.count entire homes calculated host listings_count_private rooms, alculated host listings_count shared rooms! drop_cols.na(df, threshold) : drop columns according to the amount of NaN values they contain threshold is a fraction between 0 and 1. If the fraction of NaNs in a column is equal or larger than the threshold, the respective columns is dropped. For
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
