kieferk / dfply

dplyr-style piping operations for pandas dataframes
GNU General Public License v3.0
889 stars 103 forks source link

dfply.X shadowing sklearn predictor data variable #16

Closed themrmax closed 7 years ago

themrmax commented 7 years ago

Hey, not sure if this is an issue for anyone else, but one of my favourite features of dfply is the X symbol, but it's annoying because of the scikit-learn convention to use X for the array of predictors ... would it make sense to change X to something else? maybe D or DF?

kieferk commented 7 years ago

Hey there,

So this will work:

from dfply import *
from dfply.base import X as DF

diamonds >> select(DF.price) >> head(3)
   price
0    326
1    326
2    327

Basically you import everything and then reimport X as whatever you want it to be called. The first import will import X, but you can overwrite that one with something else. Hope that helps!

themrmax commented 7 years ago

Cool, yeah that makes sense, different people might have difference preferences, this way you can do whatever you want!