Skip to main content

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.92.5 | Python: ≥3.7 (≥3.8 recommended) | Pandas: 1.3.0 - 3.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 1.3-3.x compatible: Compatibility wrappers avoid pandas 2.x/3.x deprecation paths while retaining support for pandas 1.3+
  • 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
  • Schedule history import: Read WCONHIST and WCONINJH Eclipse schedule history records with inferred FIELD or METRIC units

Installation

To install from pypi.org:

pip install simpandas

To upgrade to the latest version:

pip install --upgrade simpandas

Requirements

  • pandas ≥1.3.0, <4.0.0
  • numpy
  • matplotlib
  • seaborn
  • unyts ≥1.0.0
  • schedule_reader ≥0.7.15 (for Eclipse schedule imports)
  • 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 Compatibility

Version 0.92.5 supports pandas 1.3.0 through the 3.x series. Compatibility wrappers avoid deprecated pandas copy arguments where pandas Copy-on-Write supersedes them. GroupBy.apply() excludes grouping columns on pandas 2.2+ to match pandas' forward behavior, while retaining the legacy call signature on older supported versions.

Selection Semantics

With Eclipse-style column names, a string can select a semantic column group. For example, sdf['WOPR'] selects columns such as WOPR:WELL-1 and WOPR:WELL-2 in their original column order. Exact column names always take precedence; strings that do not resolve to a column or name pattern can resolve to date-like index labels.

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 (September 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.
  • Resolved ambiguous string selection between name-pattern columns and datetime indexes without pandas indexing warnings.
  • Added pandas 3.x compatibility for replace, set_index, concat, rename, align, astype, and GroupBy.apply().
  • Updated schedule-reader string normalization for pandas 3.x dtype-selection behavior.

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, SimIndex, ColumnUnits, concat,
    read_excel, read_csv, read_json, read_hdf5, read_parquet,
    read_summary, read_sr3, read_schedule, read_vdb,
)
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.

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.92.5.tar.gz (229.1 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.92.5-py3-none-any.whl (208.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for simpandas-0.92.5.tar.gz
Algorithm Hash digest
SHA256 6583ef86eee4a8a57f61514e75d2523846ab9c6b3bb58c2a92a203892e31d40d
MD5 8dd3144bf1563a31e48c597649971273
BLAKE2b-256 d8cf37e8c398fff78212dac13d2328bf9fb6a689b6e8a257eaf76318a8918bcb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for simpandas-0.92.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b8ba9c61ee3c1a5493c1344795c4643b11bf177315ecdd750a0403a9129f832e
MD5 3311e51ff2f7075fc2f3e9f41369e5ab
BLAKE2b-256 04a7ca20a9e22dfe6d3271f336ec18de01e9508f20071721ac780d116aa23ff7

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.92.5 This release

2 files

0.91.0

2 files

0.90.12

2 files

0.90.11

2 files

0.90.9

2 files

0.90.8

2 files

0.90.7

2 files

0.90.6

2 files

0.90.5

2 files

0.90.0

2 files

0.83.22

2 files

0.83.21

2 files

0.83.20

2 files

0.83.16

2 files

0.83.15

2 files

0.83.14

2 files

0.83.12

2 files

0.83.11

2 files

0.83.10

2 files

0.83.9

2 files

0.83.8

2 files

0.83.7

2 files

0.83.6

2 files

0.83.5

2 files

0.83.4

2 files

0.83.3

2 files

0.83.2

2 files

0.83.1

2 files

0.83.0

2 files

0.82.4

2 files

0.82.1

2 files

0.82.0

2 files

0.80.8

2 files

0.80.7

2 files

0.80.5

2 files

0.80.4

2 files

0.80.2

2 files

0.80.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page