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.4.0.tar.gz (4.3 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.4.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for datasci_bricoletc-0.4.0.tar.gz
Algorithm Hash digest
SHA256 962d45053adb66ead39f2b312423f32885f3841c93f53ddaf35a9d55adaf4fa6
MD5 9c0aa01b826808c93b7f54dfed4bd46b
BLAKE2b-256 424da8cb596d6cd3081b36825f6a3abfa643ddb18c13aa63c8019fa11fa98e0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for datasci_bricoletc-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dccf604ef925d36f93ab1121530e81766873e00ca264a16b55697445d2e29007
MD5 2b199c44a00fddae8a14821acb14e06b
BLAKE2b-256 a63eb54099ab41185fa9e5b3ab1d808a2140e0f984170dccd81a203dd8fc436e

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