Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --wide flag option for measurements #10

Open
majesticio opened this issue Aug 30, 2023 · 1 comment
Open

Add --wide flag option for measurements #10

majesticio opened this issue Aug 30, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@majesticio
Copy link
Contributor

majesticio commented Aug 30, 2023

Currently, the output for measurements is displayed in a long format. Introducing a --wide flag can reshape the output data into a wide format. This will make it easier for users to view and compare measurements for different parameters side by side.

Example (shortened for brevity)

"long" format

parameter DATETIME_LOCAL VALUE
no2 ppm 2023-08-29 08:00:00 0.0093
so2 ppm 2023-08-29 08:00:00 0

"wide" format that would use --wide flag

DATETIME_LOCAL no2 ppm value so2 ppm value
2023-08-29 08:00:00 0.0093 0

example use: openaq measurements list 2178 --from 2023-08-29 --wide

@majesticio majesticio added the enhancement New feature or request label Aug 30, 2023
@russbiggs
Copy link
Member

Something to consider with wide format: Since the column length is variable joining between two outputs can be difficult:

e.g. consider Location A which measures PM2.5 and PM10 and Location B PM2.5, PM10, NO2 and SO2
Location A in wide format may look like:

DATETIME_LOCAL PM2.5 value PM10 value
2023-08-29 08:00:00 0.0093 0

while Location B may look like:

DATETIME_LOCAL NO2 value SO2 value PM2.5 value PM10 value
2023-08-29 08:00:00 1.1 1 0.93 0.0234

If I wanted to join these two CSVs (append one to the other) it would be difficult due to the difference number of columns (also the columns may not be in the same order).

This can be worked around with a static number of columns for wide for format, i.e. ALL parameters supported by OpenAQ, which would make joining two or more locations easier. The downside would obviously be LOTS of columns which LOTS of null values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants