<jupyter_start><jupyter_text><NAME>  Research question/interestsWhen are symptoms of anxiety disorder highest and lowest in California?<jupyter_code>import numpy as np
import pandas as pd
import seaborn as sns
sns.set_theme(style= "whitegrid", font_scale= 1.2)
import pandas as pd
pd.read_csv("../data/raw/Indicators_of_Anxiety_or_Depression_Based_on_Reported_Frequency_of_Symptoms_During_Last_7_Days.csv")<jupyter_output><empty_output><jupyter_text>Milestone 3 Task 1  Loading Data<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# cvs data

df = pd.read_csv("../data/raw/Indicators_of_Anxiety_or_Depression_Based_on_Reported_Frequency_of_Symptoms_During_Last_7_Days.csv")
raw = df.drop(columns=['Phase','Time Period','Subgroup','Group','Time Period Start Date','Time Period Start Date','Time Period End Date','Low CI','High CI','Quartile Range'])
raw.dropna()<jupyter_output><empty_output><jupyter_text>Cleaning DataCleaning the dataframe so it only contains the following:- Indicator: Symptoms of Anxiety Disorder- State: California- Percentage (Value)- Confidence Interval<jupyter_code>raw.drop(raw[raw["Indicator"] != "Symptoms of Anxiety Disorder"].index, inplace=True)
raw.drop(raw[raw["State"] != "California"].index, inplace=True)

raw = raw.rename(columns={"Value":"Level"})
raw = raw.rename(columns={"Time Period Label":"Time Period"})
df_clean = raw.reset_index(drop=True)
df_clean.to_csv('rajsomal_cleanedData.csv',index=False)<jupyter_output><empty_output><jupyter_text>EDA<jupyter_code>df_cleaned = pd.read_csv("../data/processed/rajsomal_cleanedData.csv")
df_cleaned.describe()
df_cleaned.describe(include=[np.number]).T
df.describe(exclude=[np.number]).T<jupyter_output><empty_output><jupyter_text>Visualizations<jupyter_code>pd.DataFrame(df.groupby("Time Period Label").mean()["Value"])
sns.barplot(x="Time Period Label",y="Value",data=df_cleaned)
sns.set(rc = {'figure.figsize':(50,15)})<jupyter_output><empty_output><jupyter_text>Task 3  Method Chaining<jupyter_code>import pandas as pd
import numpy as np
import seaborn as sns

df = (
    pd
    .read_csv("../data/raw/Indicators_of_Anxiety_or_Depression_Based_on_Reported_Frequency_of_Symptoms_During_Last_7_Days.csv")
    .drop(columns=['Phase','Time Period','Subgroup','Group','Time Period Start Date','Time Period Start Date','Time Period End Date','Low CI','High CI','Quartile Range'])
    .dropna()
    .rename(columns={"Percentage":"Level"})
)

df.drop(df[df["Indicator"] != "Symptoms of Anxiety Disorder"].index, inplace=True)
df.drop(df[df["State"] != "California"].index, inplace=True)
df.reset_index(drop=True)<jupyter_output><empty_output><jupyter_text>Wrapping Method Chain in Function<jupyter_code>def load_and_process(url):
    df = (
        pd
        .read_csv(url)
        .drop(columns=['Phase','Time Period','Subgroup','Group','Time Period Start Date','Time Period Start Date','Time Period End Date','Low CI','High CI','Quartile Range'])
        .dropna()
        .rename(columns={"Percentage":"Level"})
    )

    df.drop(df[df["Indicator"] != "Symptoms of Anxiety Disorder"].index, inplace=True)
    df.drop(df[df["State"] != "California"].index, inplace=True)
    
    return df.reset_index(drop=True)


load_and_process("../data/raw/Indicators_of_Anxiety_or_Depression_Based_on_Reported_Frequency_of_Symptoms_During_Last_7_Days.csv")<jupyter_output><empty_output><jupyter_text>Function Moved into a new .py file<jupyter_code>import project_function1
df = project_function1.load_and_process("../data/raw/Indicators_of_Anxiety_or_Depression_Based_on_Reported_Frequency_of_Symptoms_During_Last_7_Days.csv")
df
import project_functions2
project_functions2.load_and_process("../data/raw/Indicators_of_Anxiety_or_Depression_Based_on_Reported_Frequency_of_Symptoms_During_Last_7_Days.csv")<jupyter_output><empty_output><jupyter_text>Task 4<jupyter_code>sns.barplot(x="Time Period Label",y="Value",data=df_cleaned)
sns.set(rc = {'figure.figsize':(50,15)})<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.137621540762902, 'fraction_numerical': 0.005983545250560957, 'mean_word_length': 8.265588914549653, 'pattern_counts': {'":': 4, '<': 38, '<?xml version=': 0, '>': 38, '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': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '610743', 'license': 'MIT', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1403, 'n_words': 215, 'path': 'notebooks/rajsomal_data.ipynb', 'repo_name': 'data301-2021-winter1/project-group-29-project-29', 'size': '4014'}