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::mutatein R) - Pandas accessor (
.chem) for fluent, chainable workflows
Installation
pip install pychemist
Usage
import pychemist as chem
Example 1: Lagging a variable
df = chem.time_shift(variables=["sales"], dataframe=data, id="company", time="year", shift=1)
Example 2: Conditional mutation
df = chem.mutate(df, query_str="region == 'West'", column="bonus", new_value=1000)
Example 3: Conditional mutation using the DataFrame accessor
df=df.chem.mutate("sales > 100", column="flag", new_value=1)
Example 4: T-test between treated and control groups
chem.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(chem.summary_no_fe(model))
MIT License Copyright (c) [2025] [Jeroen van Raak]
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
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 pychemist-0.0.1.tar.gz.
File metadata
- Download URL: pychemist-0.0.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81d804bfda78dce87bad4cb355e5820b1694efcb33f9004767f88329e3f8945d
|
|
| MD5 |
62668bca7f725d32b8ba68950d1b2e48
|
|
| BLAKE2b-256 |
f8b4302d71e2ac78547faa50901e987b704e6bfd6e67b74cac34d7d0e6448ca8
|
File details
Details for the file pychemist-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pychemist-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a47a1366784627ed25938ff346a61f51b891b1c9eb2be2fa9b8414f036bd4c73
|
|
| MD5 |
81edf77ab78a085ee93d7b0a95015e5d
|
|
| BLAKE2b-256 |
bcee225c4b901504dab552f8ac434b34c70b107590e683149af6eb2e01c27a96
|