Skip to main content

Location date features as dataframe

Project description

SpaceTimePandas

Location and date features from a bunch of api sources to Pandas. Repository hosted on GitHub.

icon

pip install SpaceTimePandas

Demo

Get a lot of space and time related features! See also demo_pipeline.ipynb or on colab [SpaceTimePandas] demo_pipeline.ipynb

>>> df
         location_name        date
0      Toronto, Canada  2020-01-01
1      Toronto, Canada  2020-01-02
2  Halifax, NS B3J 1M3  2020-01-01
3  Halifax, NS B3J 1M3  2020-01-02

Define a collection of features.

>>> from stpd.location import OpenStreetMap, SimpleMaps
>>> from stpd.pipeline import Pipeline
>>> from stpd.utils_geocode import GeoCode
>>> from stpd.weather import NOAA, ClimateWeatherGC
>>> p = Pipeline([
>>>     GeoCode(location_name_col='location_name', lat_col='lat', lon_col='lon'),
>>>     OpenStreetMap(lat_col='lat', lon_col='lon'),
>>>     SimpleMaps(lat_col='lat', lon_col='lon'),
>>>     NOAA(date_col='date', lat_col='lat', lon_col='lon'),
>>>     ClimateWeatherGC(date_col='date', lat_col='lat', lon_col='lon'),
>>> ])
>>> features = p.add_features_to_df(df)
>>> features.shape
(4, 60)

Preview of a single row (some columns truncated).

>>> features.iloc[0]
location_name                Toronto, Canada
date                              2020-01-01
lat                                43.653482
lon                               -79.383935
count_natural=tree                       719
count_natural=water                       15
...
iso2                                      CA
iso3                                     CAN
admin_name                           Ontario
capital                                  NaN
population                         5429524.0
...
STATION                          USC00309690
TMAX                                    83.0
TMIN                                    -6.0
...
Heat Deg Days (°C)                      14.4
Heat Deg Days Flag                      None
...
Total Snow (cm)                          NaN
Total Snow Flag                         None
...
Dir of Max Gust (10s deg)                NaN
Dir of Max Gust Flag                       M
...
Name: 0, dtype: object

You can of course use the components above individually.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SpaceTimePandas-0.1.1.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SpaceTimePandas-0.1.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file SpaceTimePandas-0.1.1.tar.gz.

File metadata

  • Download URL: SpaceTimePandas-0.1.1.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.10

File hashes

Hashes for SpaceTimePandas-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2f103a38154bb2e4361cf7758247c510226a9957bca90d8ebf8dd5eeb4a3f366
MD5 aa6d84c46ed7a4b904c7d3c5ed4bce0c
BLAKE2b-256 89b7cea43a25c5d004c13cfcae4902dc4c7bd3123e1e4aa53b1dca2834dc8f70

See more details on using hashes here.

File details

Details for the file SpaceTimePandas-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: SpaceTimePandas-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.10

File hashes

Hashes for SpaceTimePandas-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 407c039fac9dd980986813d792249fac2f9f2ab951581d7d79158fbd843384ca
MD5 f6d2a40e5f5e75a4872c6b7c91f3b9d0
BLAKE2b-256 388259c2ddadbfec8cb642a721602debf2457f6e7dd716afb398065246cde500

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page