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.8 | 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
  • Eclipse/OPM summary round-trip: Read/write .SMSPEC + .UNSMRY files with to_summary / read_summary and optional OPM or ECLIPSE naming style

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 as_dict() and from_dict() for SimSeries with unyts instance support.
  • Fixed KeyError in __setitem__ when re-assigning columns and preserved existing units.
  • Added regression coverage in test/test_bugfix_dca.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, read_summary, concat
from simpandas.index import SimIndex

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

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.8.tar.gz (210.3 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.8-py3-none-any.whl (195.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpandas-0.90.8.tar.gz
  • Upload date:
  • Size: 210.3 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.8.tar.gz
Algorithm Hash digest
SHA256 842c2b2c01f7d171915ff551c69b8d4660831628f971fc150f9510d1417b1e45
MD5 5530abe5ad74700d5e1641d74399d1b4
BLAKE2b-256 05588d9bb6d14f7ec344fc409125deb03d3b0bc0fe25e7db511b1bdc4b5f5aa4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simpandas-0.90.8-py3-none-any.whl
  • Upload date:
  • Size: 195.6 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 808114c8998bc66acf551138828b1c9ce3024669d4617560be6a11c9f5bbed70
MD5 f3a294864e4947c0f36103e0f04e9f8d
BLAKE2b-256 bc0212f836999e418b9a2708fda568271fa5712c7dc8af5fa230c12815f466e5

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