Skip to main content

Python package developed for the Lancaster Air Quality project

Project description

LancasterAQ Package

Python package developed for the Lancaster Air Quality project.

Included are tools to:

  • Import the dataset
  • Convert the dataset to different formats

Installation Instructions

PyPI Installation

$ pip install LancasterAQ

Manual Installation

Local install

# clone from github
$ git clone https://github.com/lgouldsbrough/LancasterAQ.git
# change directory into project root
$ cd LancasterAQ

# regular install
$ pip install .
# or 
# development install 
# $ pip install -e .

Directly install from GitHub

# pip install from github
pip install git+https://github.com/lgouldsbrough/LancasterAQ.git
# or `python -m pip ...` for environment safety 

Example notebook

An introductory notebook can be found within the examples folder.

Note: requires Matplotlib and Seaborn packages.

Loading in the Lancaster AQ dataset

import LancasterAQ as laq

# load tabular data
data = laq.TabularObject()

# OR load the graph object
data = laq.GraphObject()

A helper function is also available:

import LancasterAQ as laq
# load tabular data
data = laq.dataset('TabularObject')
# OR load the graph object
data = laq.dataset('GraphObject')

Convert the tabular data to different formats

To avoid implicit data copies replace the data object with the dataset function call.

For example: replace data.to_numpy() with laq.TabularObject().to_numpy()

Convert to a pandas dataframe

data = data.to_pandas()

Convert to a numpy array

data = data.to_numpy()

Convert the graph object to different formats

To avoid implicit data copies replace the data object with the dataset function call.

For example: replace data.to_numpy() with laq.GraphObject().to_numpy()

Convert to a numpy sparse array

# returns the graph adjacency matrix as a numpy array
numpy_array = data.to_numpy()

Convert to a dictionary of dictionaries

# returns adjacency representation of graph as a dictionary of dictionaries
dict_of_dicts = data.to_dict()

Convert to an edge list

# returns a list of edges in the graph
edge_list = data.to_edgelist()

Convert to a dictionary of lists

# returns adjacency representation of graph as a dictionary of lists
dict_of_lists = data.to_dict_of_lists()

Convert to a scipy sparse array

# returns the graph adjacency matrix as a scipy sparse array
scipy_sparse_array = data.to_scipy()

Convert to JSON

# returns json object of graph
data_json = data.to_json()

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

LancasterAQ-1.0.0.tar.gz (3.4 MB view details)

Uploaded Source

File details

Details for the file LancasterAQ-1.0.0.tar.gz.

File metadata

  • Download URL: LancasterAQ-1.0.0.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for LancasterAQ-1.0.0.tar.gz
Algorithm Hash digest
SHA256 053b4dee101681f1265840245b667a4a677505e32c26d5d6040dae87d67fb9f3
MD5 c333a8f9ee1bd50d603181527b5fe981
BLAKE2b-256 ee12095937f3cbb238dcc3965b6383cb2509df3e849d822a1467f1b90972cf8e

See more details on using hashes here.

Supported by

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