<jupyter_start><jupyter_text>Task 1 **Here we only clean the data, wrangle it for our analysis**<jupyter_code># Imported Items
import pandas as pd
import numpy as np

path = r"./data/processed/worldometers_snapshots_April18_to_September20.csv"
df = pd.read_csv(path)
df.head()
## 2. cleaning data 
# We are only going to focus on the Total Cases,Deaths,Recovered and also keep teh Population in mind, to see 
# what perecentage of the population was positive. These methods were used to remove the coloumns

##df.drop("Active_Cases",axis=1,inplace=True)
##df.drop("Serious_or_Critical",axis=1,inplace=True)
df.drop("Total_Tests",axis=1,inplace=True)
#removed all NaN
df.dropna()
df.head()
## 3. Processing 

df["Percentage_Positive_Population"] = df["Total_Cases"]/df["Population"] *100
df.head()
## 4. Wrangled data 
df["Date"]=pd.to_datetime(df["Date"])
df.head()<jupyter_output><empty_output><jupyter_text>Task 2**Here we redo the methods above**<jupyter_code>## Step 1: Load Data

path = r"./data/processed/worldometers_snapshots_April18_to_September20.csv"

# Method chaining begins

df1= (
    pd.read_csv(path)
    .dropna()   
    .sort_values("Date",ascending=True)
)



# Creating Function and method Chaining
#path = r"./data/processed/worldometers_snapshots_April18_to_September20.csv"
def load_and_process(path):
    
    df1= (
    pd.read_csv(path)
    .dropna()   
    .sort_values("Date",ascending=True)
    )
    
    df2 = (
        df1
        .drop("Active_Cases",axis=1,inplace=True)
        .drop("Serious_or_Critical",axis=1,inplace=True)
        .drop("Total_Tests",axis=1,inplace=True)
        .assign(Percentage_Positive_Population=df["Total_Cases"]/df["Population"] *100)
        
    )
    return df2<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13075611142694712, 'fraction_numerical': 0.019897669130187607, 'mean_word_length': 4.732899022801303, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '113584', 'license': 'MIT', 'n_tokens_mistral': 675, 'n_tokens_neox': 625, 'n_words': 125, 'path': 'Task.ipynb', 'repo_name': 'data301-2021-summer2/project-group18-project', 'size': '1759'}