Skip to content
Permalink
f8944e4b75
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
24 lines (17 sloc) 633 Bytes
#DATA CLEANING CODE =
import pandas as pd
import dask.dataframe as dd
#This loads datasets using Dask
df = dd.read_csv("Trips_By_Distance.csv")
df_full = dd.read_csv("Trips_Full_Data.csv")
df = df.fillna(df.mean())
df_full = df_full.fillna(df_full.mean())
#Convert data types
df["Population Staying at Home"] = df["Population Staying at Home"].astype("int64")
df_full["Week"] = df_full["Week"].astype("int64")
df = df.drop_duplicates().compute()
df_full = df_full.drop_duplicates().compute()
print(df.head())
print(df_full.head())
print(df.isna().sum().compute())
print(df_full.isna().sum().compute())