<jupyter_start><jupyter_text>Project 7: Explanatory Data Analysis & Advanced Visualization (Baby Names Dataset)<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
pd.options.display.float_format = '{:.2f}'.format<jupyter_output><empty_output><jupyter_text>The most popular names<jupyter_code>df = pd.read_csv('us_baby_names.csv')
df.columns<jupyter_output><empty_output><jupyter_text>This is the non-unique values in each column<jupyter_code>df.nunique()<jupyter_output><empty_output><jupyter_text>Converting gender as categorical type<jupyter_code>df['Gender'] = df['Gender'].astype('category')<jupyter_output><empty_output><jupyter_text>Dataframe with names of 2018<jupyter_code>df_names_2018 = df[df['Year'] == 2018].copy()<jupyter_output><empty_output><jupyter_text>The most counted names<jupyter_code>df_names_2018.nlargest(10,'Count')<jupyter_output><empty_output><jupyter_text>The most counted female names<jupyter_code>df_names_2018[df_names_2018['Gender'] == 'F'].nlargest(10,'Count')<jupyter_output><empty_output><jupyter_text>The most counted male names<jupyter_code>df_names_2018[df_names_2018['Gender'] == 'M'].nlargest(10,'Count')
def most_pop(year,gender,n):
    conditions = True
    conditions &= df['Year']   == year
    conditions &= df['Gender'] == gender
    return df[conditions].nlargest(n,'Count')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13583815028901733, 'fraction_numerical': 0.028901734104046242, 'mean_word_length': 10.638655462184873, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '516545', 'license': 'MIT', 'n_tokens_mistral': 536, 'n_tokens_neox': 495, 'n_words': 71, 'path': 'Project_07_Materials/.ipynb_checkpoints/main-checkpoint.ipynb', 'repo_name': 'emdemor/PythonDataScienceWithPandas_Exercises', 'size': '1384'}