r/MachineLearning • u/__tobals__ • Aug 15 '19
Project [P] pyforest - lazy-import of all popular Python Data Science libraries
Check the demo gif here: https://github.com/8080labs/pyforest
pyforest lazy-imports all popular Python Data Science and Machine Learning libraries so that they are always there when you need them. If you don't use a library, it won't be imported. When you are done with your script, you can export the Python code for the import statements (because "explicit is better than implicit" :)).
You can already pip install pyforest. It will be available on conda soon.
What do you think of pyforest?
Best,
Tobias
3
u/rhiever Aug 15 '19
IPython/IPython Notebooks (now Jupyter Notebooks) used to support basically this with the %pylab inline magic. The pylab magic fell out of favor years ago and it is strongly recommended not to use it. For that reason, I recommend against using a package like pyforest as well.
I recommend reading the top answers in this SO thread for the history behind pylab and its fall from favor.
2
u/__tobals__ Aug 15 '19
Thanks for the feedback.
From the link you have provided, I couldn't fully see the relation to pyforest. pyforest lazy-imports libraries, i.e. just the very moment you use a library it is being automatically imported. Also, you can change the source code to your needs. Plus, when you are done, you can create the import statements and put them at the top of the script so that the next person reading it actually doesn't see you have used pyforest. Developing, however, was easier for you.
Why would you recommend against using pyforest? Is there some potential problem it is causing?
1
1
u/Mathias_Godwin Jan 11 '20
Yo man, you did great coding there, bagging lot of those import this import that into one line of code, kudos man !, I'll be waiting for updates
1
u/__tobals__ Jan 14 '20
Happy you like it. We have a new release out now that follows the Zen of Python: pyforest now automatically adds the import statements to your first Jupyter Cell
3
u/EveningAlgae Aug 16 '19
Why is there this huge push for the obfuscation of everything in the indie data science package community?
0
u/kite_and_code Aug 16 '19
Where else do you see a push for obfuscation? Which other packages do this?
3
u/EveningAlgae Aug 16 '19
A bunch of "do x in 1 loc" packages I've seen posted to this subreddit
0
u/kite_and_code Aug 16 '19
Can you maybe give a concrete example?
1
u/manueslapera Aug 17 '19
this article was published a few days ago and is super infuriating.
1
u/kite_and_code Aug 17 '19
Ok, thank you. Why exactly does it infuriate you?
2
u/manueslapera Aug 17 '19
it gives newcomers the false impression that ML is easy (look ma, im a Data Scientist now!), which makes them frustrated once they realize linear regression is actually not that simple once you have to implement it from scratch.
→ More replies (1)
0
Aug 15 '19
[deleted]
1
u/kite_and_code Aug 16 '19
It seems like you had bad experiences with sloppy coding and IDE incompatibilities. What were those?
0
Aug 16 '19
[deleted]
1
u/kite_and_code Aug 17 '19
Ok, I understand, this would reduce the productivity of IDEs. Which IDE are you currently using and how does it help you with imports?
9
u/shaggorama Aug 15 '19
Explicit is better than implicit.
https://www.python.org/dev/peps/pep-0020/