patsy equivalent of R's all.vars
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 990
- Forks
- 106
- Avg merge
- 7d 34m
- Merged PRs (30d)
- 1
Description
Hey patsy developers, I wonder how can we retrieve the variable names from the model formula string (in R, this can be done via the all.vars function). For example,
if I have ("y ~ x1:x2 + np.log(x3) + I(x4^2)"), I want to return a list of ['x1', 'x2', 'x3', 'x4'].
Similarly, if I have ("~cr(time, df = 3)"), I want to return a list of ['time'].
Your help is highly appreciated!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how patsy parses the formula strings shown in the issue. The change is done when an interface returns ['x1', 'x2', 'x3', 'x4'] for the first example and ['time'] for the cr(time, df = 3) example, including variables nested in interactions and function calls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100