Skip to main content

Python DataFrame with fast insert and appends

Project description

Python DataFrame with fast insert and appends

https://badge.fury.io/py/raccoon.svg Documentation Status

Documentation

http://raccoon.readthedocs.io/en/latest/

Source location

Hosted on GitHub: https://github.com/rsheftel/raccoon

Overview

Raccoon is a lightweight DataFrame and Series implementation inspired by the phenomenal Pandas package for the one use case where Pandas is known to be sub-optimal: DataFrames and Series that grow in size by adding rows frequently in the code. Additionally Raccoon DataFrames and Series can be parametrized to be sorted so that additions to the DataFrame keep the index in sorted order to speed inserts and retrievals.

A simple speed comparison of Raccoon vs Pandas for typical functionality is located in the documentation.

Inspiration

Pandas DataFrames and Series are excellent multi-purpose data structures for data management and analysis. One of the use cases I had was to use DataFrames as a type of in-memory database table. The issue was that this required lots of growing the number rows of the DataFrame, something that is known to be slow in Pandas. The reason it is slow in Pandas is that the underlying data structure is numpy which does a complete copy of the data when the size of the array grows.

Functionality

Raccoon implements what is needed to use the DataFrame as an in memory store of index and column data structure supporting simple and tuple indexes to mimic the hierarchical indexes of Pandas. The methods included are primarily about setting values of the data frame, growing and appending the data frame and getting values from the data frame. The raccoon DataFrame is not intended for math operations like pandas and only limited basic math methods are included.

Underlying Data Structure

Raccoon uses the standard built in lists as its default underlying data structure. There is an option on object construction to use any other drop-in replacement for lists. For example the fast blist package http://stutzbachenterprises.com/blist/ could be used as a list replacement for the underlying data structure.

Why Raccoon?

According to wikipedia some scientists believe the panda is related to the raccoon

Contributing

Contribution in the form of pull requests are welcome. Use pytest to run the test suite. Be sure any new additions come with accompanying tests.

Future

This package serves the needs it was originally created for. Any future additions by myself will be driven by my own needs, but it is completely open source so I encourage anyone to add on and expand.

My hope is that one day Pandas solves the speed problem with growing DataFrames and this package becomes obsolete.

Python Version

Raccoon requires Python 3.11 or greater. Python 2.7 support was eliminated as of version 3.0. If you need to use raccoon with Python 2.7 use any version less than 3.0

Helper scripts

There is helper function to generate these docs from the source code. On windows cd into the docs directory and execute make_docs.bat from the command line. To run the test coverage report run the coverage.sh script.

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

raccoon-3.3.1.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

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

raccoon-3.3.1-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file raccoon-3.3.1.tar.gz.

File metadata

  • Download URL: raccoon-3.3.1.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for raccoon-3.3.1.tar.gz
Algorithm Hash digest
SHA256 f5dc300b84c6609406892f55c6cb1747f38768b50c444e50115298d71f2c6487
MD5 c23a0faca7280c871ad43008d40294a2
BLAKE2b-256 1756367d7ded7bbd5daa84e3ea7b94d5575f63b066d0f8bb88a2e17db6adb976

See more details on using hashes here.

File details

Details for the file raccoon-3.3.1-py3-none-any.whl.

File metadata

  • Download URL: raccoon-3.3.1-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for raccoon-3.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43b4cb29d124b9d46e384608725bd9580e2a4ba732a29525d1f6153162b3d475
MD5 04d5dfff8403076c039cdf6b5c46b4ab
BLAKE2b-256 5968f43b7541d408558f7710cf3a88f677f8ae133e61a54db1440f3153b86244

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