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
"""Module to merge the OpenCovid19-FR and data.gouv.fr datasets. | |
The function provided by this script (`download_france_data`) pulls the latest | |
data from: | |
* https://raw.githubusercontent.com/opencovid19-fr/data/master/dist/chiffres-cles.csv | |
* https://www.data.gouv.fr/fr/datasets/r/f335f9ea-86e3-4ffa-9684-93c009d5e617 | |
renames the columns of the data.gouv dataset to match the opencovid19 dataset and | |
merges the two datasets. The data is returned as a pandas dataframe. |
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
"""Benchmarking of numpy array creation through loops, indexing, list | |
comprehension and generator expressions. | |
Requires: | |
- pip install numpy pytest pytest-benchmark | |
Run with: | |
pytest benchmark_array_creation.py |
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 numpy as np | |
from multiprocessing import Pool | |
from itertools import repeat | |
import time | |
import pandas as pd | |
# Little test of https://stackoverflow.com/questions/49367278/any-way-to-speed-up-numpy-cumsum | |
# DOES NOT WORK | |
def parallel_cumsum(arr_in, arr_out, axis=0): |