Skip to main content

An extension to tidypolars4sci with additional functionalities for scientific data analysis.

Project description

tidypolars-extra

tidypolars-extra is an extension of tidypolars4sci, which provides Tidyverse-like functions for data manipulation and analysis in Python using Polars as the backend.

This project builds upon the original tidypolars4sci by adding extra functionalities and improvements while maintaining the same familiar API.

Features

  • Tidyverse-style API for Polars DataFrames
  • Scientific research utilities including LaTeX table generation
  • Fast data manipulation powered by Polars
  • Familiar R-like syntax for Python users

Installation

You can install tidypolars-extra with pip:

pip install tidypolars-extra

Basic usage

tidypolars-extra methods are designed to work like tidyverse functions:

import tidypolars_extra as tp

# create tibble data frame
df = tp.tibble(x = range(3),
               y = range(3, 6),
               z = ['a', 'a', 'b'])

(
    df
    .select('x', 'y', 'z')
    .filter(tp.col('x') < 4, tp.col('y') > 1)
    .arrange(tp.desc('z'), 'x')
    .mutate(double_x = tp.col('x') * 2,
            x_plus_y = tp.col('x') + tp.col('y')
            )
)
┌─────┬─────┬─────┬──────────┬──────────┐
 x    y    z    double_x  x_plus_y 
 ---  ---  ---  ---       ---      
 i64  i64  str  i64       i64      
╞═════╪═════╪═════╪══════════╪══════════╡
 2    5    b    4         7        
├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
 0    3    a    0         3        
├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
 1    4    a    2         5        
└─────┴─────┴─────┴──────────┴──────────┘

Converting to/from pandas data frames

If you need to use a package that requires pandas or polars data frames, you can convert from a tidypolars_extra tibble to either of those DataFrame formats.

# convert to pandas...
df = df.to_pandas()
# ... or convert to polars
df = df.to_polars()

To convert from a pandas or polars DataFrame to a tidypolars tibble:

# convert from pandas...
df = tp.from_pandas(df)
# or covert from polars
df = tp.from_polars(df)

Acknowledgments

This project is an extension of:

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

tidypolars_extra-0.1.0.tar.gz (684.4 kB view details)

Uploaded Source

Built Distribution

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

tidypolars_extra-0.1.0-py3-none-any.whl (712.4 kB view details)

Uploaded Python 3

File details

Details for the file tidypolars_extra-0.1.0.tar.gz.

File metadata

  • Download URL: tidypolars_extra-0.1.0.tar.gz
  • Upload date:
  • Size: 684.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tidypolars_extra-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d1842119338d4f6788f64bf77ff700792db2c80a2a5ea223ef8cda85aa83e861
MD5 124f656f15dc7d7d06cc883c9dbd3dca
BLAKE2b-256 ee8e3f42849f42a3261c582e418f02d5c0cd26bab5835732307ba61a101504a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tidypolars_extra-0.1.0.tar.gz:

Publisher: publish.yml on mdmanurung/tidypolars-extra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tidypolars_extra-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tidypolars_extra-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a5d22b93de50cf38435be9b36a38a81ae0555077b48d63d34f59be433bfb5c7
MD5 8bf4f23a060081adaa73eb9ffe5cb4ff
BLAKE2b-256 18e28af5cbe40d54a9aca271594f22a7206c471b65aebc3517c5786739a8e3e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for tidypolars_extra-0.1.0-py3-none-any.whl:

Publisher: publish.yml on mdmanurung/tidypolars-extra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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