Skip to content

Instantly share code, notes, and snippets.

@dmesquita
Created December 8, 2019 18:52
Show Gist options
  • Save dmesquita/38fc7037b906bb1c348e0ece064d0fbb to your computer and use it in GitHub Desktop.
Save dmesquita/38fc7037b906bb1c348e0ece064d0fbb to your computer and use it in GitHub Desktop.
import pandas as pd
import modin.pandas as pd_modin
import cudf as pd_cudf
results_loading = []
### Read in the data with Pandas
for run in range(0,30):
s = time.time()
df = pd.read_csv("../inep/dados/microdados_educacao_superior_2018//microdados_ed_superior_2018/dados/DM_ALUNO.CSV")
e = time.time()
results_loading.append({"lib":"Pandas","time":float("{}".format(e-s))})
print("Pandas Loading Time = {}".format(e-s))
### Read in the data with Modin
for run in range(0,30):
s = time.time()
df = pd_modin.read_csv("../inep/dados/microdados_educacao_superior_2018//microdados_ed_superior_2018/dados/DM_ALUNO.CSV")
e = time.time()
results_loading.append({"lib":"Modin","time":float("{}".format(e-s))})
print("Modin Loading Time = {}".format(e-s))
### Read in the data with cudf
for run in range(0,30):
s = time.time()
df = pd_cudf.read_csv("../inep/dados/microdados_educacao_superior_2018//microdados_ed_superior_2018/dados/DM_ALUNO.CSV")
e = time.time()
results_loading.append({"lib":"Cudf","time":float("{}".format(e-s))})
print("Cudf Loading Time = {}".format(e-s))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment