Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/machow/siu
Symbolic expression library for python
https://github.com/machow/siu
Last synced: about 1 month ago
JSON representation
Symbolic expression library for python
- Host: GitHub
- URL: https://github.com/machow/siu
- Owner: machow
- Created: 2020-08-17T19:09:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-17T19:14:02.000Z (over 4 years ago)
- Last Synced: 2024-11-16T11:37:15.694Z (about 2 months ago)
- Size: 1000 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# siu
Symbolic expression library for python## Key features
* Symbolic expressions
* Call trees
* Tree visitors
* Generic function dispatch### Symbolic expressions
A siu expression is a way of specifying **what** action you want to perform.
This allows siuba verbs to decide **how** to execute the action, depending on whether your data is a local DataFrame or remote table.```python
from siuba import __.cyl == 4
``````
Out[2]:
█─==
├─█─.
│ ├─_
│ └─'cyl'
└─4
```You can also think of siu expressions as a shorthand for a lambda function.
```python
from siuba import _# lambda approach
mtcars[lambda _: _.cyl == 4]# siu expression approach
mtcars[_.cyl == 4]
``````
Out[3]:
mpg cyl disp hp drat wt qsec vs am gear carb
2 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1
7 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2
.. ... ... ... ... ... ... ... .. .. ... ...
27 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2
31 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2[11 rows x 11 columns]
```See [siu expression section here](https://siuba.readthedocs.io/en/latest/intro.html#Concise-pandas-operations-with-siu-expressions-(_)).
### Call trees
### Tree visitors
### Generic function dispatch