My utilities for basic data science
Project description
datasci
Tents: tabular entries
Build a TSV
from datasci import Tents
header = ["col1", "col2", "col3"]
tents = Tents(header=header)
for val1, val2, val3 in zip([1,2], [3,4], [5,6]):
new_tent = tents.new()
new_tent.update(col1=val1)
new_tent.col2 = val2
new_tent["col3"] = val3
tents.add(new_tent)
with open("outfile.tsv", "w") as ofstream:
print(tents, file=ofstream)
$cat outfile.tsv
col1 col2 col3
1 3 5
2 4 6
Load a TSV
from datasci import Tents
tents = Tents.from_tsv("outfile.tsv") # If the TSV does not have a header, you can also specify it with the 'header' argument
tents.sort(key_name="col1", descending=True)
print(tents)
col1 col2 col3
2 4 6
1 3 5
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
datasci_bricoletc-0.4.1.tar.gz
(49.6 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 datasci_bricoletc-0.4.1.tar.gz.
File metadata
- Download URL: datasci_bricoletc-0.4.1.tar.gz
- Upload date:
- Size: 49.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcf3b6800eccee3f370343a7cc5e3ea37912f061705089885660afd2d3d76d75
|
|
| MD5 |
a54df61e2ac4d2da12d7b3157750d5c7
|
|
| BLAKE2b-256 |
64591f082b1ec66cab0e18d1a7830b8f6ad54bbe561cfb65a3f83970c757f014
|
File details
Details for the file datasci_bricoletc-0.4.1-py3-none-any.whl.
File metadata
- Download URL: datasci_bricoletc-0.4.1-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be6ff5f633fbc43f05365a80ca8031782c21dad4eeefb37450f0a9fcbebb9c0b
|
|
| MD5 |
355dfcb500175db1b75d40f5c40160c3
|
|
| BLAKE2b-256 |
d3d9fe99c39039fba604e32ae0819d90709c158d1725719256c6bff36ecca690
|