Skip to main content

A pandas extension package for enhanced data manipulation and analysis

Project description

pardos: Quality of Life extensions for pandas

pardos is a Python package that extends the functionality of pandas, providing additional methods for enhanced data manipulation and analysis. It aims to simplify common data operations and introduce new features to make working with pandas DataFrames and Series more efficient and intuitive.

Methods are provided as custom accessors or directly added as methods for DataFrames and Series, allowing you to perform operations directly on your data without the need for additional functions or libraries.

Features

  • Custom accessors for DataFrames and Series
  • Additional data manipulation methods
  • Time-based operations
  • Unix-like file operations on paths stored in Series
  • Human-readable time parsing

Installation

You can install pardos using pip:

pip install pardos

Usage

To use pardos, simply import it after importing pandas:

import pandas as pd
import pardos

Now you can use the additional methods and accessors provided by pardos on your pandas DataFrames and Series.

Examples

Select rows based on column values

df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
result = df.select(A=2)

Add a new column based on existing ones

def new_column(A, B):
    return A + B

df.augment(new_column)

Remove constant columns

df = df.drop_constant()

Use human-readable time parsing

df["date"] = pd.to_datetime(df["date"])
recent = df[df["date"].hdt.within("2d")]  # Rows within the last 2 days

Perform Unix-like operations on file paths

file_paths = pd.Series(["/path/to/file1.txt", "/path/to/file2.txt"])
file_paths.unix.cp("/new/directory")

Contributing

Contributions to pardos are welcome! Please feel free to submit a Pull Request.

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

pardos-0.0.1.tar.gz (20.9 kB view hashes)

Uploaded Source

Built Distribution

pardos-0.0.1-py3-none-any.whl (17.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page