Python bindings for LocaleDB.
- LocaleDB
- Python 3
- folium
- matplotlib
- numpy
- pandas
- psycopg2
- pywt
- scipy
- scikit-learn
- scikit-learn-extra
- tslearn
pip install git+https://github.com/momacs/localedb-py.git
Remember to activate your venv
of choice unless you want to go system-level.
from localedb import LocaleDB
db = LocaleDB()
print(db.get_rand_us_state_fips(3)) # select three random U.S. state FIPS codes
print(db.get_rand_us_county_fips(3)) # select three random U.S. county FIPS codes
db.set_disease('COVID-19') # set COVID-19 as the current disease
db.set_locale_by_name('Italy') # set Italy as the current locale
db.set_locale_by_name('US', 'Alaska') # set the state of Alaska as the current locale
db.set_locale_by_us_fips('02') # same
db.set_locale_by_name('US', 'Alaska', 'Anchorage') # set the county of Anchorage, Alaska as the current locale
db.set_locale_by_us_fips('02020') # same
conf = db.get_dis_dyn_by_day_conf(20,77) # get the time series of confirmed cases from day 20 to day 77
print(conf.flatten().tolist()) # print that time series
The last instruction should result in the following being printed:
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 3, 5, 5, 5, 7, 16, 17, 21, 30, 35, 45, 59, 61, 63, 66, 68, 75, 82, 86, 89, 99, 105]
The following computational notebooks (located in a separate repository) demonstrate the usage and capabilities of the package:
- Data Access
- Multivariate Time Series Clustering
- Multivariate Time Series Clustering (Continuous Wavelet Transform)
- Multivariate Time Series Clustering (Mapping)
- Multivariate Time Series Clustering (Distance Matrices)
- Multivariate Time Series Clustering (Performance Evaluation)
This project is licensed under the BSD License.