Get data column by column from the CSV file export by lab.js. Use Pandas.
Project description
labcsv.py
You can easily get the data you need columns from lab.js.csv!
Installation
pip install labcsv
How to Use
Read CSV
from labcsv import read_csv,DefaultHeaderName as LHName
rlab = read_csv("tests/test.csv") #<- path
Get columns data
The type of data returned is ndarray.
values = rlab.get_column_values(LHName.SENDER) #n×1 size
# or
values = rlab.get_column_values([LHName.SENDER,LHName.RESPONSE,LHName.DURATION]) # n×3 size
# or
values = rlab.get_column_values("Param1") #custom column name
# or
values = rlab.get_column_values([LHName.SENDER, "Param1"]) #multiple
nan to empty string
from labcsv import read_csv,DefaultHeaderName as LHName
rlab = read_csv("tests/test.csv")
rlab.pandas_data.fillna('', inplace=True) #<---
print(rlab.get_column_values("Param1"))
You can use pandas functions.
Get meta
meta = rlab.get_meta()
print(meta["labjs_version"])
print(meta["language"])
print(meta["location"])
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
labcsv-1.0.2.tar.gz
(3.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file labcsv-1.0.2.tar.gz.
File metadata
- Download URL: labcsv-1.0.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1cc16cc3f6493a2db4c45077cfe08427871fe5b8d5e91d4a7bff28f5d805ee6
|
|
| MD5 |
ec382b3015db21fd27ba140ada711b45
|
|
| BLAKE2b-256 |
a72b2e502b34837b5c3ea435e0f815f1d6eb146713563d14a95304fc1cdd1800
|
File details
Details for the file labcsv-1.0.2-py3-none-any.whl.
File metadata
- Download URL: labcsv-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e32d1405182285690044d6d22799f03ed8559943cba8dee7a7bc23c924c352d
|
|
| MD5 |
2046dff38e8817937bd284f965fd846c
|
|
| BLAKE2b-256 |
de9ff5646d23afbd27842a225a3f57d04b1d5c8c176ee86dc9af40ca84627d7e
|