Turtle slowly walks in spiral in search for Zen of programming. |
Basically, I have a need to find enough "visual" modules, probably under 10 modules, that give me starting tools so that I could create some interesting Image Output, in the way that Wolfram Language can.
Wolfram Lab Cloud indeed is powerful visually. I don't know how to explain, but being able to query Planets images (or all kind of stuff), and then seeing the list as image picture of some sort, then filtering the list or further scrambling the images... are brilliant.
So, I do have come to some realization that a lot of codes are to be required and studied in order to be able to make some of the "cool stuffs" that Wolfram can do much easier.
Yet, still, there is a good feeling of being able to do it using open source tools, even when the results are basics. Continue on searching for what I am looking for.
Soon, I will slow down and try to explore area that I am interested the most.
TIPS:
Installing Python module often is as simple as running "pip install" in the Command Prompt (Windows) or Terminal (Mac). If you are using Anaconda, it comes with a bundle of modules already pre-installed for you. You may need to run "conda install" for adding module.MODULE: ipythonblocks
http://ipythonblocks.org/bcMjcaI have mentioned this one in the previous blog post. ipythonblocks should be a great starter easy basic exploration that give you output of visual colorful blocks. This is a good module to study before anyone attempting to jump into PIL or Pillow module for further image processing and dealing with bigger number of pixels.
NOTE:
For this ipythonblocks, if you like to export out image, you can use the save_image("output.png") method. But you need PIL/Pillow module to be loaded in order for this to work. So there is this can of dependency of module. Something to keep in mind.
Thanks to Matt Davis for this tip.
It was Mardi Gras over the weekend and I was coding at home! |
MODULE: Turtle
Turtle is one of old drawing module from legacy Python 2.7, that can still work inside Jupyter. If you want inline output, you can use this mobilechelonian module. It does not have all the original Turtle methods, however, it can still work.
Installing modules can be as easy as typing this in Terminal, for this one you do this:
pip install mobilechelonian
MODULE: WordCloud
We all love word cloud.
Type this in Terminal:
pip install wordcloud
Above should work, if you have all the requirements. I tested on Mac, it works.
However, I found that sometimes working in Windows, PIP stuff often fail to install. For the wordcloud module, I found out in Windows that I don't have Microsoft Visual C++ vcvarsall.bat (compiler). It is pretty dumb thing.
Working in Mac and Linux, and things tend to be smoother.
https://github.com/amueller/word_cloud
http://peekaboo-vision.blogspot.com.au/2012/11/a-wordcloud-in-python.html
MODULE: matplotlib
This one module should come pre-installed. If you have been using this Jupyter Notebook (was iPython Notebook) and reading lots of documentations, you will find matplotlib is used quite a lot. You will also find plotly module.http://www.labri.fr/perso/nrougier/teaching/matplotlib/
You will find that matplotlib, together with numpy, and PIL will work together to give you the output inline inside Jupyter.
http://nbviewer.jupyter.org/gist/minrk/7076095
http://qiita.com/zaburo/items/5637b424c655b136527a
MODULE: NetworkX
matplotlib and plotly are quite big in itself.
Sometimes we also like to make flowchart or node graph, for that reasons, module like Network X should give you the tool you need.
http://networkx.readthedocs.org/en/networkx-1.11/overview.html
MODULE: ipywidgets
http://ipywidgets.readthedocs.org/en/latest/I have not tested every widgets built in for Jupter. However, even by understanding the basic like slider widget can add a powerful interactivity that helps you to understand code.
Below I am using pythonblocks together with ipywidgets.
Below is similar with above, just to create checked pattern. I changed around the code like testing different RGB block color, but the point is for value that I make to interact, the result will be shown instantly, and this will explain the code better.
NOTE:
I would love to be able to embed the Jupyter Notebook itself that is interactive into Blogger at some point. I need to search around for this information.
Turning a Notebook into HTML can be done quite easily following this blog post:
http://prooffreaderplus.blogspot.com.au/2014/11/how-to-quickly-turn-ipython-notebook.html
I supposed above are enough interesting modules. Should keep one busy, whether for purpose of turning data into some sort of visualization.
Perhaps there are modules that can do animation, etc. Maybe Processing Javascript can also be embedded inside Jupyter Notebook? Don't know yet.
Looks like with Jupyter Notebook, we are starting to see the future of narrative. Especially with example books by Google that cannot be printed.
https://editionsatplay.withgoogle.com/#/
MODULE: ipython.display
One more thing... actually a lot more things. IPython.display module itself can display and visualize inline inside the Notebook. This alone is worth exploring.
My old photo: "cat in the pot" |
MODULE: Bokeh
Another plotting module with style.http://bokeh.pydata.org/en/latest/docs/user_guide/quickstart.html
MODULE: Cairo
Well, it's not Processing, however, it let you draws complexity, if you dare.http://cairographics.org/
TEXT TO SPEECH MODULE
http://pyttsx.readthedocs.org/en/latest/install.htmlhttps://github.com/parente/pyttsx
Supposedly simple and straight forward to install and to use. I am using Windows 7, 64 bit and was using Python 3. But failed to run properly. I then switch to Python 2.7 environment and install the pyttsx and it works fine. Although in Windows, I only have the voice of Microsoft Anna. Will try this on Mac and see it has more voices.
Making computer speaking is easy, making it listen apparently could be interesting. Here link below takes you to a tutorial that uses "BitVoicer", good cheap server listener:
http://letsmakerobots.com/node/41226
I like this robotic video, a lot:
https://www.youtube.com/watch?v=xs0MVZD1LsI&feature=share
Fast forward....
3D VISUALIZATION USING BLENDER AND PYTHON
I don't know if Blender will every be possible to be under Jupyter Notebook. Maybe having something like Jupyter Notebook inside Blender will be a cool thing one day. That will be pretty weird interesting.But, at some stage, I will focus on 3D visualization, and maybe working with Particles and Point Cloud to do 3D visualization. Interesting book:
http://www.cv.nrao.edu/~bkent/blender/thebook.html
Blender has Python Console running Python 3, and it has Text Editor built in already. So that is quite handy and helpful already:
Well I just tested something like below with numpy. Random 3 values array generated and visualized.
http://blender.stackexchange.com/questions/2407/how-to-create-a-mesh-programmatically-without-bmesh
http://blender.stackexchange.com/questions/5745/creating-a-geometry-from-a-python-array
So Blender, will be my Jupyter -> visualize 3D cloud way. Will see ...
Comments
Post a Comment