Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.7%) to scientific vocabulary
Keywords
Repository
Unified slicing for all Python data structures.
Basic Info
Statistics
- Stars: 35
- Watchers: 4
- Forks: 4
- Open Issues: 2
- Releases: 5
Topics
Metadata Files
README.md
slicer [alpha]
(Equal Contribution) Samuel Jenkins & Harsha Nori & Scott Lundberg
slicer wraps tensor-like objects and provides a uniform slicing interface via __getitem__.
It supports many data types including:
numpy | pandas | scipy | pytorch | list | tuple | dict
And enables upgraded slicing functionality on its objects: ```python
Handles non-integer indexes for slicing.
S(df)[:, ["Age", "Income"]]
Handles nested slicing in one call.
S(nested_list)[..., :5] ```
It can also simultaneously slice many objects at once: ```python
Gets first elements of both objects.
S(first=df, second=ar)[0, :] ```
This package has 0 dependencies. Not even one.
Installation
Python 3.6+ | Linux, Mac, Windows
sh
pip install slicer
Getting Started
Basic anonymous slicing: ```python from slicer import Slicer as S li = [[1, 2, 3], [4, 5, 6]] S(li)[:, 0:2].o
[[1, 2], [4, 5]]
di = {'x': [1, 2, 3], 'y': [4, 5, 6]} S(di)[:, 0:2].o
{'x': [1, 2], 'y': [4, 5]}
```
Basic named slicing: ```python import pandas as pd import numpy as np df = pd.DataFrame({'A': [1, 3], 'B': [2, 4]}) ar = np.array([[5, 6], [7, 8]]) sliced = S(first=df, second=ar)[0, :] sliced.first
A 1
B 2
Name: 0, dtype: int64
sliced.second
array([5, 6])
```
Real example: ```python from slicer import Slicer as S from slicer import Alias as A
data = [[1, 2], [3, 4]] values = [[5, 6], [7, 8]] identifiers = ["id1", "id1"] instancenames = ["r1", "r2"] featurenames = ["f1", "f2"] full_name = "A"
slicer = S( data=data, values=values, # Aliases are objects that also function as slicing keys. # A(obj, dim) where dim informs what dimension it can be sliced on. identifiers=A(identifiers, 0), instancenames=A(instancenames, 0), featurenames=A(featurenames, 1), fullname=fullname, )
sliced = slicer[:, 1] # Tensor-like parallel slicing on all objects assert sliced.data == [2, 4] assert sliced.instancenames == ["r1", "r2"] assert sliced.featurenames == "f2" assert sliced.values == [6, 8]
sliced = slicer["r1", "f2"] # Example use of aliasing assert sliced.data == 2 assert sliced.featurenames == "f2" assert sliced.instancenames == "r1" assert sliced.values == 6 ```
Contact us
Raise an issue on GitHub, or contact us at interpret@microsoft.com
Owner
- Name: InterpretML
- Login: interpretml
- Kind: organization
- Email: interpret@microsoft.com
- Website: https://interpret.ml
- Repositories: 15
- Profile: https://github.com/interpretml
If a tree fell in your random forest, would anyone notice?
GitHub Events
Total
- Issues event: 2
- Push event: 4
- Pull request review event: 1
- Pull request event: 2
- Create event: 1
Last Year
- Issues event: 2
- Push event: 4
- Pull request review event: 1
- Pull request event: 2
- Create event: 1
Committers
Last synced: 10 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| InterpretML | 5****l | 21 |
| Scott Lundberg | s****g@m****m | 4 |
| connortann | 7****n | 3 |
| natsukium | t****i@g****m | 1 |
| S Jenkins | 6****e | 1 |
| Paul Koch | c****e@k****a | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 4
- Total pull requests: 4
- Average time to close issues: 3 days
- Average time to close pull requests: 2 months
- Total issue authors: 3
- Total pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 4.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- slundberg (2)
- connortann (1)
- detrin (1)
Pull Request Authors
- connortann (6)
- natsukium (2)
- Copilot (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- pypi 8,624,320 last-month
- Total docker downloads: 407,562
-
Total dependent packages: 27
(may contain duplicates) -
Total dependent repositories: 852
(may contain duplicates) - Total versions: 13
- Total maintainers: 2
pypi.org: slicer
A small package for big slicing.
- Homepage: https://github.com/interpretml/slicer
- Documentation: https://slicer.readthedocs.io/
- License: MIT License
-
Latest release: 0.0.8
published almost 2 years ago
Rankings
Maintainers (1)
spack.io: py-slicer
slicer wraps tensor-like objects and provides a uniform slicing interface via __getitem__
- Homepage: https://github.com/interpretml/slicer
- License: []
-
Latest release: 0.0.7
published about 3 years ago
Rankings
Maintainers (1)
conda-forge.org: slicer
- Homepage: https://github.com/interpretml/slicer
- License: MIT
-
Latest release: 0.0.7
published about 5 years ago
Rankings
anaconda.org: slicer
slicer wraps tensor-like objects and provides a uniform slicing interface via __getitem__.
- Homepage: https://github.com/interpretml/slicer
- License: MIT
-
Latest release: 0.0.8
published over 1 year ago
Rankings
Dependencies
- actions/checkout v4 composite
- actions/setup-python v5 composite