Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: "target ~ ." syntax #10

Open
szs8 opened this issue Oct 29, 2012 · 38 comments
Open

Feature request: "target ~ ." syntax #10

szs8 opened this issue Oct 29, 2012 · 38 comments

Comments

@szs8
Copy link

szs8 commented Oct 29, 2012

R lets you regress a target against all the variables in the dataframe by simply typing "target ~ ."
This is particularly useful when we have lots of columns and don't want to specify each predictor. I don't think patsy supports this yet. Any chance if it can be added? Thanks.

@jseabold
Copy link
Member

jseabold commented May 1, 2013

Just came to file this same request, so +1

@ltrabuco
Copy link

ltrabuco commented Feb 2, 2014

+1

@CamDavidsonPilon
Copy link
Contributor

+1 to this feature

@rowanv
Copy link

rowanv commented May 29, 2014

This feature would be great!

@idrisr
Copy link

idrisr commented Sep 21, 2014

+1

4 similar comments
@yw5aj
Copy link

yw5aj commented Nov 18, 2014

+1

@makmanalp
Copy link

+1

@clarkfitzg
Copy link
Member

+1

@nicke5012
Copy link

+1

@makmanalp
Copy link

I haven't had a chance to read through the code entirely:

This looks like it'd be a new kind of PYTHON_EXPR. https://github.com/pydata/patsy/blob/master/patsy/parse_formula.py#L68

And then maybe some code here would need to be modified - not sure of this:
https://github.com/pydata/patsy/blob/master/patsy/eval.py

@njsmith
Copy link
Member

njsmith commented Mar 3, 2015

It should probably be a new token type, if expr_text == ".": token_type = "DOT" or similar.

eval.py wouldn't need any changes -- that's for evaluating Python code, and . is not a Python expression :-). Instead you'd want to look at desc.py, which has the code for taking a formula parse tree and converting it into termlists.

#28 ended up not getting merged, but if anyone's interested in having a go at implementing this, then there's some discussion there of the right way to do it.

@dankessler
Copy link

+1

5 similar comments
@eriklarson
Copy link

+1

@michelleowen
Copy link

+1

@ao1
Copy link

ao1 commented Apr 30, 2016

+1

@irinfox
Copy link

irinfox commented May 10, 2016

+1

@carojasq
Copy link

+1

@joeitaliand
Copy link

+1000

@harikarajavaram
Copy link

This feature would make things easy, +1

@joeitaliand
Copy link

Yes! Could not agree more.

On Jul 8, 2016, at 12:14 AM, Harika Rajavaram notifications@github.com wrote:

This feature would make things easy, +1


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@FayolChang
Copy link

+1

6 similar comments
@JDallasGriffin
Copy link

+1

@mrandrewandrade
Copy link

+1

@sdmurff
Copy link

sdmurff commented Feb 15, 2017

+1

@whryan
Copy link

whryan commented Feb 23, 2017

+1

@eric-czech
Copy link

+1

@ghost
Copy link

ghost commented Jul 25, 2017

+1

@apachaves
Copy link

+1

@mcastillon
Copy link

+2

@semerj
Copy link

semerj commented Sep 27, 2017

+1

@shoyer
Copy link
Member

shoyer commented Sep 27, 2017

Please don't ping this issue with "+1" comments: hit 👍 on the first post instead.

As @njsmith wrote above, this is open to pull requests by an interested party. Pinging this issue will not make it happen any faster :).

@hoondy
Copy link

hoondy commented Feb 9, 2019

++

@steve-the-bayesian
Copy link

I'd like to use patsy to drive code other than "model.matrix". In R you can write
plot(y ~ x) or table(y ~ x) to indicate the structure of a plot or contingency table.

@ernestomi
Copy link

++ such a useful functionality

@Timuchin
Copy link

Timuchin commented Jul 16, 2020

++

@alexanderquispe
Copy link

++++++++++++++++

@benyamindsmith
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests