Skip to main content

a couple of Pandas DataFrame and Series subclasses with extensions to work with units and to deal with column names in eclipse simulator output style.

Project description

simpandas

A couple of Pandas DataFrame and Series subclasses, extended to work with units and to deal with column names following the style of eclipse simulator outputs.

This package is under development and is regularly updated. Back-compatibility is intended to be maintained when possible.

Version: 0.90.6 | Python: ≥3.7 (≥3.8 recommended) | Pandas: 1.3.0 - 2.x

What Contains This Package

It is powered by other packages, like NumPy, seaborn and unyts and further own methods, to be able to deal with tables of quantities and facilitate common manipulations of time-dependent data.

Key Features

  • Unit-aware DataFrames and Series: Automatic unit tracking and conversion using unyts
  • Pandas 2.x compatible: Works with both pandas 1.x and 2.x
  • Enhanced I/O: Read/write Excel, CSV, and JSON files with unit metadata preservation
  • Expanded pandas wrapper coverage: ffill, bfill, pct_change, asfreq, combine_first, isin, compare, swaplevel, align, update, resample, and between now return Sim types where applicable
  • Time-series utilities: Built-in methods for daily, monthly, yearly aggregations
  • Eclipse-style simulator support: Handle column naming conventions from reservoir simulators

Installation

To install from pypi.org:

pip install simpandas

To upgrade to the latest version:

pip install --upgrade simpandas

Requirements

  • pandas ≥1.3.0, <3.0.0
  • numpy
  • matplotlib
  • seaborn
  • unyts ≥1.0.0
  • openpyxl (for Excel support)
  • xlsxwriter (for Excel writing)
  • packaging (for version detection)

Quick Start

from simpandas import SimDataFrame, SimSeries, read_csv, read_json

# Create a DataFrame with units
df = SimDataFrame(
    {'velocity': [1, 2, 3], 'temperature': [25, 30, 35]},
    units={'velocity': 'm/s', 'temperature': 'degC'}
)

# Units are preserved through operations
result = df * 2
print(df.get_units())  # Access unit information

# Read CSV/JSON with units
df = read_csv('data.csv', units=0)  # units in row 0 after the header
df = read_json('data.json')         # restores units from SimPandas JSON

Compatibility Notes

Pandas 2.x Support

Version 0.84.0+ is fully compatible with pandas 2.x while maintaining backward compatibility with pandas 1.3.0+. The deprecated .append() method has been replaced with pd.concat() internally.

Python Version

  • Minimum: Python 3.7
  • Recommended: Python 3.8 or higher

Breaking Changes in v0.84.0

The writters module has been renamed to writers (correcting spelling). For backward compatibility:

# Deprecated (still works with warning):
from simpandas.writters import write_excel

# New (recommended):
from simpandas.writers import write_excel

Maintenance Updates (April 2026)

  • Added wrappers for missing pandas methods in SimBasics to preserve metadata through more operations.
  • Added _SimResampleProxy and resample() support on both SimDataFrame and SimSeries.
  • Fixed filter parsing infrastructure by wiring common.filters.key_to_string(...) correctly from SimSeries.filter() and SimDataFrame.filter().
  • Added regression coverage in test/test_audit_bugs.py and test/test_missing_wrappers.py.

Documentation

For detailed documentation, examples, and API reference, see:

  • USER_MANUAL.md - Comprehensive user manual for classes, functions, and modules
  • docs/USER_GUIDE.md - Shorter quick-start guide
  • DEVELOPER_MANUAL.md - Internal architecture and contributor-focused technical notes
  • CONTRIBUTING.md - Contribution workflow and release checklist
  • CHANGELOG.md - Version history and migration guides
  • WHATS_NEW.md - Highlights for the current release
  • simpandas_demo.ipynb - Interactive examples and tutorials
  • test/ - Comprehensive test suite with usage examples

API At A Glance

from simpandas import SimDataFrame, SimSeries, read_excel, read_csv, read_json, concat
from simpandas.index import SimIndex

from simpandas.writers.xlsx import write_excel
from simpandas.writers.schedule import write_schedule

Contributing

Contributions are welcome! Please ensure:

  1. Code passes all tests: pytest test/
  2. Follow existing code style
  3. Add tests for new features
  4. Update documentation as needed

Testing

Run the test suite:

cd simpandas
pytest test/ -v

License

See LICENSE file for details.

Author

Martín Carlos Araya martinaraya@gmail.com

Changelog

See CHANGELOG.md for detailed version history.

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

simpandas-0.90.6.tar.gz (207.6 kB view details)

Uploaded Source

Built Distribution

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

simpandas-0.90.6-py3-none-any.whl (190.9 kB view details)

Uploaded Python 3

File details

Details for the file simpandas-0.90.6.tar.gz.

File metadata

  • Download URL: simpandas-0.90.6.tar.gz
  • Upload date:
  • Size: 207.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for simpandas-0.90.6.tar.gz
Algorithm Hash digest
SHA256 1f01109bff92b784cc1bddfb3407550cb5f9d9be585193336cc86daa105faacc
MD5 554144496703220ef75ca16d42d4ce34
BLAKE2b-256 e98aef7b152985f5e934e1511b6ec1b6a937818b92e732adcadbe5e6db9dd139

See more details on using hashes here.

File details

Details for the file simpandas-0.90.6-py3-none-any.whl.

File metadata

  • Download URL: simpandas-0.90.6-py3-none-any.whl
  • Upload date:
  • Size: 190.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for simpandas-0.90.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1f3f9a3cd078d35ee26c83964174ac0c683b76c7b5ba8a485a72d83f9a2cb32e
MD5 4586882fdd66aee3e5eb7a6d71dad27e
BLAKE2b-256 bc011449323dcb0742e877a41931b6b01467a7d74ddd9848653d031313d9902c

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