Created
December 8, 2019 18:55
-
-
Save dmesquita/15d1988169bb09491338924fd51a782a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import modin.pandas as pd_modin | |
import cudf as pd_cudf | |
results_fillna = [] | |
### Read in the data with Pandas | |
for run in range(0,30): | |
df = pd.read_csv("../inep/dados/microdados_educacao_superior_2018//microdados_ed_superior_2018/dados/DM_ALUNO.CSV") | |
s = time.time() | |
df = df.fillna(value="0") | |
e = time.time() | |
results_fillna.append({"lib":"Pandas","time":float("{}".format(e-s))}) | |
print("Pandas Fillna Time = {}".format(e-s)) | |
### Read in the data with Modin | |
for run in range(0,30): | |
df = pd_modin.read_csv("../inep/dados/microdados_educacao_superior_2018//microdados_ed_superior_2018/dados/DM_ALUNO.CSV") | |
s = time.time() | |
df = df.fillna(value="0") | |
e = time.time() | |
results_fillna.append({"lib":"Modin","time":float("{}".format(e-s))}) | |
print("Modin Fillna Time = {}".format(e-s)) | |
### Read in the data with cudf | |
for run in range(0,30): | |
df = pd_cudf.read_csv("../inep/dados/microdados_educacao_superior_2018//microdados_ed_superior_2018/dados/DM_ALUNO.CSV") | |
s = time.time() | |
df = df.fillna(value="0") | |
e = time.time() | |
results_fillna.append({"lib":"Cudf","time":float("{}".format(e-s))}) | |
print("Cudf Fillna Time = {}".format(e-s)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment