Skip to main content

Transform raw data into insights.

Project description

Pychemist

Transform raw data into insights.

Pychemist is a lightweight Python library designed to simplify and enrich your data science workflow. Inspired by the ancient craft of alchemy, it helps you turn raw data into analytical gold through expressive, intuitive tools built on top of pandas, statsmodels, and other popular Python data science libraries.


Features

  • Create lagged or lead variables for time-series and panel data
  • Run quick, readable t-tests on treatment groups
  • Filter model summaries to hide fixed effects
  • Conditional mutation of DataFrames (similar to dplyr::mutate in R)
  • Pandas accessor (.pch) for fluent, chainable workflows

Installation

pip install pychemist

Usage

import pychemist as pch

Example 1: Lagging a variable

df = pch.time_shift(variables=["sales"], dataframe=data, id="company", time="year", shift=1)

Example 2: Conditional mutation

df = pch.mutate(df, query_str='division == 24 & managerID==15014', "bonus", 1000)

Example 3: Conditional mutation using the DataFrame accessor

df=df.pch.mutate('company_id == "8ga62sav" & year==2025', "total_assets", 82000000)

Example 4: T-test between treated and control groups

pch.ttest(df, variable="outcome", treatment="treated")

Example 5: Model summary without fixed effects

import statsmodels.formula.api as smf
model = smf.ols("y ~ x + C(firm)", data=df).fit()
print(pch.summary_no_fe(model))

MIT License Copyright (c) Jeroen van Raak (2025)

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

pychemist-0.0.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

pychemist-0.0.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file pychemist-0.0.2.tar.gz.

File metadata

  • Download URL: pychemist-0.0.2.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pychemist-0.0.2.tar.gz
Algorithm Hash digest
SHA256 943ea5c9f72657bcead07c8790720397722b31070f2b82798c0dd0333367c63f
MD5 da32183458a86082b199c13b1ff4d5c8
BLAKE2b-256 a2ceb301d7ae80e386850850f3df1343bb728d5a3ccf987692392d29aac019c4

See more details on using hashes here.

File details

Details for the file pychemist-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: pychemist-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for pychemist-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 49ded6fe1bae0920e512b10ca972efd0b7b4ac4db957bcc3ebe8491bbdf5c4ff
MD5 f8eb43ea08bbc41510ce63689e329439
BLAKE2b-256 8baa2985939c36771f9b5d0bd16362eae2c11b98d902f25ffc12692b0bebb7c8

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