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
Read columns as any type
- default: "001" -> 1.0
- str type: "001" -> "001"
rlab = read_csv("tests/test.csv",dtype={"Param2":str})
*"Param2" is a header name
*The specifications are the same as for pandas.
Get columns data
The return type is ndarry (get_column_values)
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
The return type is list (get_column_list)
senders,time_commits = rlab.get_column_list([LHName.SENDER,LHName.TIME_COMMIT])
print(senders)
print(time_commits)
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"])
Metadata
Release files for labcsv 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| labcsv-1.0.4.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| labcsv-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.0 kB
Release files / labcsv-1.0.4.tar.gz
| Download URL | labcsv-1.0.4.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67dfb63124af19f3430a2e39b9075ecdc955ce577d0551e6ad9d1b36925f1291
|
|
BLAKE2b-256 checksum How to use checksums |
61510567a8a0b74c4f354e35e824ae9bdb8b579656af5dc167e6068ab3d38e77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.11.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / labcsv-1.0.4-py3-none-any.whl
| Download URL | labcsv-1.0.4-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c7225f80903fb2abd76825dbbdc72d0fe8d2990fc38676072ec219d8c20a9cd3
|
|
BLAKE2b-256 checksum How to use checksums |
87a41ad5d715d6ad9ab11f6f323e871a7f768969067b1d84422f8dfeebaf9429
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.11.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|