Skip to main content

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


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.3.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datasci_bricoletc-0.3.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file datasci_bricoletc-0.3.1.tar.gz.

File metadata

  • Download URL: datasci_bricoletc-0.3.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.14

File hashes

Hashes for datasci_bricoletc-0.3.1.tar.gz
Algorithm Hash digest
SHA256 6fd4fa4e201304d2101c668fd5db5d6f32f9eda02bd44af7980eec9cc7bb1142
MD5 e5003d72f6fc1e7fca4fdd6d34115770
BLAKE2b-256 eb6ae63883772545cbba698bc7d37b3c53b08c1c1a6e604808c57beac57f709a

See more details on using hashes here.

File details

Details for the file datasci_bricoletc-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for datasci_bricoletc-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0aef2e1e859f06a305c328c8606bfcf078b84a89676607512f063aea51ff57e0
MD5 52cfe58a3939b00dc628e00c980381c3
BLAKE2b-256 74750114241b1f35ade498b06ad8578deaca6abd845717675857495816e92ffa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page