Read KorEXO sonde profile CSV files
Project description
korexo_profile
Read KorEXO sonde profile CSV files.
Full package documentation is on Read the Docs.
Install
$ pip install korexo_profile
Usage
KorEXO file straight to a table:
>>> import korexo_profile
>>> data = korexo_profile.read("../tests/example1_full.csv")
>>> df = korexo_profile.convert_datasets_to_df(data["datasets"])
Or, for the full set of information:
>>> import korexo_profile
>>> data = korexo_profile.read("../tests/example2.csv")
>>> data.keys()
dict_keys(['metadata', 'datasets', 'dataframe'])
>>> df = data["dataframe"]
>>> df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 9 entries, 0 to 8
Data columns (total 22 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Date (MM/DD/YYYY) 9 non-null object
1 Time (HH:mm:ss) 9 non-null object
2 Time (Fract. Sec) 9 non-null int64
3 Site Name 9 non-null object
4 Cond µS/cm 9 non-null int64
5 Depth m 9 non-null float64
6 nLF Cond µS/cm 9 non-null float64
7 ODO % sat 9 non-null float64
8 ODO % local 9 non-null float64
9 ODO mg/L 9 non-null float64
10 ORP mV 9 non-null float64
11 Pressure psi a 9 non-null float64
12 Sal psu 9 non-null int64
13 SpCond µS/cm 9 non-null float64
14 TDS mg/L 9 non-null int64
15 pH 9 non-null float64
16 pH mV 9 non-null float64
17 Temp °C 9 non-null float64
18 Vertical Position m 9 non-null float64
19 Battery V 9 non-null float64
20 Cable Pwr V 9 non-null float64
21 DTW 1 non-null float64
dtypes: float64(15), int64(4), object(3)
memory usage: 1.7+ KB
Or each dataset at a time:
>>> data["datasets"][0]
{'name': 'Date',
'column': 'Date (MM/DD/YYYY)',
'sensor': '',
'mean': <NA>,
'stdev': <NA>,
'data': [datetime.date(2020, 10, 16),
datetime.date(2020, 10, 16),
datetime.date(2020, 10, 16),
datetime.date(2020, 10, 16),
datetime.date(2020, 10, 16),
datetime.date(2020, 10, 16),
datetime.date(2020, 10, 16),
datetime.date(2020, 10, 16),
datetime.date(2020, 10, 16)],
'median': datetime.date(2020, 10, 16)}
>>> data["datasets"][1]
{'name': 'Time',
'column': 'Time (HH:mm:ss)',
'sensor': '',
'mean': <NA>,
'stdev': <NA>,
'data': array(['15:49:33', '15:49:34', '15:49:35', '15:49:36', '15:49:37',
'15:49:38', '15:49:39', '15:49:40', '15:49:41'], dtype=object),
'median': '15:49:33'}
>>> data["datasets"][9]
{'name': 'ODO mg/L',
'column': 'ODO mg/L',
'sensor': '19D101830',
'mean': 7.66,
'stdev': 0.97,
'data': array([9.5 , 9.5 , 9.49, 9.49, 9.5 , 9.49, 9.49, 9.5 , 9.49]),
'median': 9.49}
And the metadata:
>>> data["metadata"]
{'created_file': datetime.datetime(2022, 4, 7, 16, 45, 10, 874033),
'modified_file': datetime.datetime(2022, 4, 7, 16, 45, 10, 875029),
'created_info': '10/16/2020 6:21:53 AM,,,,,,,,,,,,,,,,,,,,',
'header_line_no': 9,
'params': ['Cond µS/cm',
'Depth m',
'nLF Cond µS/cm',
'ODO % sat',
'ODO % local',
'ODO mg/L',
'ORP mV',
'Pressure psi a',
'Sal psu',
'SpCond µS/cm',
'TDS mg/L',
'pH',
'pH mV',
'Temp °C',
'Vertical Position m',
'Battery V',
'Cable Pwr V',
'DTW'],
'sensors': ['19A103955',
'19B104242',
'19A103955',
'19D101830',
'19D101830',
'19D101830',
'19B105042',
'19B104242',
'19A103955',
'19A103955',
'19A103955',
'19B105042',
'19B105042',
'19A103955',
'19B104242',
'19C000969',
'19C000969',
''],
'means': [1172.5,
0.605,
1277.2,
85.5,
85.6,
7.66,
47.1,
0.859,
0.64,
1268.1,
824,
<NA>,
-126,
20.679,
0.812,
3.13,
11.4,
nan],
'stdevs': [566.7,
0.791,
617.1,
9.2,
9.2,
0.97,
1.1,
1.123,
0.31,
612.7,
398,
0.1,
5.7,
0.8,
0.972,
0,
0,
nan]}
Full package documentation is on Read the Docs.
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
korexo_profile-0.7.tar.gz
(23.3 kB
view details)
Built Distribution
File details
Details for the file korexo_profile-0.7.tar.gz
.
File metadata
- Download URL: korexo_profile-0.7.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1fdf849b4688a585e8a14b66ebd3c2cb50724b8cc502dbe58bce4c596295731 |
|
MD5 | 94f4e875bd80aecbefedb5561ad93ced |
|
BLAKE2b-256 | f8709b0667148ef7131de99aeb763ba7267efaea2352753282e5289a86fb239d |
File details
Details for the file korexo_profile-0.7-py3-none-any.whl
.
File metadata
- Download URL: korexo_profile-0.7-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66ad474160aab453938eaec44a6fed5b16629b79c270ebbb837ac9bda2dce36a |
|
MD5 | ad84ee008ac61b2f7ce8f39c12e39355 |
|
BLAKE2b-256 | 3262be51ef971df21f0b8107569a4d48d1450928bf9b66df2ef93bd59b21e1ca |