
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Formulaic is a high-performance implementation of Wilkinson formulas for Python.
It provides:
pandas.DataFramenarwhals including
pyarrow.Tablepolars.DataFramepandas.DataFramenumpy.ndarrayscipy.sparse.CSCMatrixnarwhals dataframe passthrough when using narwhals dataframes.import pandas
from formulaic import Formula
df = pandas.DataFrame({
'y': [0, 1, 2],
'x': ['A', 'B', 'C'],
'z': [0.3, 0.1, 0.2],
})
y, X = Formula('y ~ x + z').get_model_matrix(df)
y =
| y | |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
X =
| Intercept | x[T.B] | x[T.C] | z | |
|---|---|---|---|---|
| 0 | 1.0 | 0 | 0 | 0.3 |
| 1 | 1.0 | 1 | 0 | 0.1 |
| 2 | 1.0 | 0 | 1 | 0.2 |
Note that the above can be short-handed to:
from formulaic import model_matrix
model_matrix('y ~ x + z', df)
Formulaic typically outperforms R for both dense and sparse model matrices, and vastly outperforms patsy (the existing implementation for Python) for dense matrices (patsy does not support sparse model matrix output).

For more details, see here.
@formula: The implementation of Wilkinson formulas for Julia.Below are some of the projects that use Formulaic:
FAQs
An implementation of Wilkinson formulas.
We found that formulaic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.