{"library":"slicer","title":"Slicer","description":"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.","status":"maintenance","version":"0.0.8","language":"en","source_language":"en","source_url":"https://github.com/interpretml/slicer","tags":["data-manipulation","slicing","numpy","pandas","scipy","pytorch","data-structures"],"install":[{"cmd":"pip install slicer","lang":"bash","label":"Install Slicer"}],"dependencies":[],"imports":[{"symbol":"Slicer","correct":"from slicer import Slicer as S"},{"note":"Alias is used for named slicing and tracking object references.","symbol":"Alias","correct":"from slicer import Alias as A"}],"quickstart":{"code":"from slicer import Slicer as S\nimport pandas as pd\nimport numpy as np\n\n# Basic anonymous slicing for lists\nli = [[1, 2, 3], [4, 5, 6]]\nresult_list = S(li)[:, 0:2].o\n# result_list will be [[1, 2], [4, 5]]\n\n# Basic anonymous slicing for dictionaries\ndi = {'x': [1, 2, 3], 'y': [4, 5, 6]}\nresult_dict = S(di)[:, 0:2].o\n# result_dict will be {'x': [1, 2], 'y': [4, 5]}\n\n# Basic named slicing for multiple objects\ndf = pd.DataFrame({'A': [1, 3], 'B': [2, 4]})\nar = np.array([[5, 6], [7, 8]])\nsliced_objects = S(first=df, second=ar)[0, :]\n# sliced_objects.first will be a pandas Series\n# sliced_objects.second will be a numpy array","lang":"python","description":"Demonstrates basic anonymous slicing for lists and dictionaries, and named slicing for a Pandas DataFrame and a NumPy array."},"warnings":[{"fix":"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.","message":"Slicer v0.0.8 fixed compatibility issues due to the renaming of `scipy.sparse` classes (e.g., `csr_matrix` to `csr_array`). Projects using older Slicer versions with newer SciPy releases may encounter `AttributeError` or unexpected behavior with sparse matrix slicing.","severity":"breaking","affected_versions":"<0.0.8"},{"fix":"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`).","message":"The library explicitly states it has '0 dependencies'. However, its core utility is to provide enhanced slicing for objects from other libraries (NumPy, Pandas, SciPy, PyTorch). To use Slicer effectively with these data types, you must install the respective underlying libraries separately.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade Slicer to version 0.0.7 or newer: `pip install --upgrade slicer`.","message":"Behavior around alias re-assignment was corrected in Slicer v0.0.7. Prior versions may have exhibited inconsistent or unexpected results when re-assigning values to aliases tracked by a Slicer object.","severity":"deprecated","affected_versions":"<0.0.7"},{"fix":"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.","message":"The project's last release was in 2021, and its development activity appears to be infrequent. While bug fixes have occurred, users should be aware that new features or rapid responses to external library changes might not be a priority.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-06T00:00:00.000Z","next_check":"2026-07-05T00:00:00.000Z"}