<jupyter_start><jupyter_text>1. `region_1` and `region_2` are pretty uninformative names for locale columns in the dataset. Create a copy of `reviews` with these columns renamed to `region` and `locale`, respectively.<jupyter_code>renamed = reviews.rename(columns = {'region_1':'region','region_2':'locale'})
renamed.head(2)<jupyter_output><empty_output><jupyter_text>2. Set the index name in the dataset to `wines`.<jupyter_code>reindexed = reviews.rename_axis('wines', axis='rows')
reindexed.head(2)<jupyter_output><empty_output><jupyter_text>3. The [Things on Reddit](https://www.kaggle.com/residentmario/things-on-reddit/data) dataset includes product links from a selection of top-ranked forums ("subreddits") on reddit.com. Run the cell below to load a dataframe of products mentioned on the */r/gaming* subreddit and another dataframe for products mentioned on the *r//movies* subreddit.<jupyter_code>gaming_products = pd.read_csv("gaming.csv")
gaming_products['subreddit'] = "r/gaming"
movie_products = pd.read_csv("movies.csv")
movie_products['subreddit'] = "r/movies"<jupyter_output><empty_output><jupyter_text>Create a DataFrame of products mentioned on either subreddit.<jupyter_code>combined_products = pd.concat([gaming_products,movie_products])<jupyter_output><empty_output><jupyter_text>4. The [Powerlifting Database](https://www.kaggle.com/dansbecker/powerlifting-database) dataset on Kaggle includes one CSV table for powerlifting meets and a separate one for powerlifting competitors. Run the cell below to load these datasets into dataframes:<jupyter_code>powerlifting_meets = pd.read_csv("meets.csv")
powerlifting_competitors = pd.read_csv("openpowerlifting.csv")<jupyter_output><empty_output><jupyter_text>Both tables include references to a `MeetID`, a unique key for each meet (competition) included in the database. Using this, generate a dataset combining the two tables into one.<jupyter_code>powerlifting_combined = powerlifting_meets.set_index("MeetID").join(powerlifting_competitors.set_index("MeetID"))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10729821169647173, 'fraction_numerical': 0.004833252779120348, 'mean_word_length': 7.884120171673819, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '578588', 'license': 'MIT', 'n_tokens_mistral': 669, 'n_tokens_neox': 667, 'n_words': 163, 'path': '6_Pandas_Renaming_Combining/Exercise/Exercise.ipynb', 'repo_name': 'lakshikaparihar/100daysofMLcode', 'size': '2069'}