Slicer is a lightweight Python package designed to provide a unified and extended slicing interface for diverse tensor-like objects. It wraps standard Python data structures (lists, dicts) and scientific computing libraries (NumPy arrays, Pandas DataFrames, SciPy sparse matrices, PyTorch tensors) to enable advanced slicing functionalities like non-integer indexing and nested slicing in a single operation. The current version is 0.0.8, with its last update in 2021, suggesting a maintenance-oriented release cadence.
pip install slicerVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic anonymous slicing for lists and dictionaries, and named slicing for a Pandas DataFrame and a NumPy array.
Upgrade Slicer to version 0.0.8 or newer: `pip install --upgrade slicer`. If using `scipy.sparse`, consult the SciPy migration guide from `spmatrix` to `sparray` for further compatibility adjustments in your code.
Ensure that `numpy`, `pandas`, `scipy`, `pytorch` (or any other library whose objects you intend to slice) are installed in your environment if you wish to use Slicer's functionality with them (e.g., `pip install numpy pandas scipy pytorch`).
Upgrade Slicer to version 0.0.7 or newer: `pip install --upgrade slicer`.
Review the GitHub repository's commit history and issue tracker (https://github.com/interpretml/slicer/pulse) to gauge current activity if long-term active maintenance is a critical factor for your application.
Install the package using pip: `pip install slicer`
Initialize `slicer.Slicer` with a supported data structure such as a list, NumPy array, Pandas DataFrame, or PyTorch tensor: `s = slicer.Slicer([1, 2, 3])`
Provide an integer value for the axis when using `dim()` or other axis-related methods: `s.dim(0)`
No dependency data recorded yet.