Skip to main content

Tools to simplify pandas-based data processing

Project description

Pandas Sans Lambdas

Tests

Pandas method chaining using assign or loc usually means using lambdas. These get repetitive and reduce readability. Pandas Sans Lambdas is a solution to this. Here's an example:

import pandas as pd
from pandas_sans_lambdas import col

df = pd.DataFrame({"a": [1,2,3], "b": [4,5,6]})

# The old way
df = df.assign(with_lambdas = lambda DF: DF["a"] ** 2 / DF["b"])

# The new way
df = df.assign(sans_lambdas = col("a") ** 2 / col("b"))

print(df)

Hopefully you agree that this is more readable!

Current project status

This package is under development. Specifically, unit test coverage is currently incomplete. Get in touch if you want to contribute to test coverage, or if you find any bugs!

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

pandas_sans_lambdas-0.1.1.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

pandas_sans_lambdas-0.1.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file pandas_sans_lambdas-0.1.1.tar.gz.

File metadata

  • Download URL: pandas_sans_lambdas-0.1.1.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for pandas_sans_lambdas-0.1.1.tar.gz
Algorithm Hash digest
SHA256 99fe8b0a374005e0fdc210b8cedfe8fb5250143dea74272f55dd0e4a5ea55fac
MD5 9cb168129657ef736001ecfa3ae62985
BLAKE2b-256 29132b624b8c99949a1dee251db10bf255cfbc82a73c3e6ab3d11f5bb15e54cc

See more details on using hashes here.

File details

Details for the file pandas_sans_lambdas-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pandas_sans_lambdas-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3ab705d12b53804ae23f09e3e91ad4b9b48bc2884e4b75d2ecdb8a5107a51ee
MD5 66c0a2b621d06e97e63edbb09dc67750
BLAKE2b-256 a6b0087ba69bb77bfef21bcbe191c94d624cfcb4e7f56643081512068fae4653

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