A viewer for Python Dict

Just found a beautiful viewer library that helps you view Python Dict object. Here is the code: “”” Created on Fri Feb 22 12:52:28 2013 @author: kranzth “”” from traits.api \ import HasTraits, Instance, Str, on_trait_change from traitsui.api \ import View, VGroup, Item, ValueEditor, TextEditor from copy import deepcopy class DictEditor(HasTraits): SearchTerm = Str() Object …

Install Theano 7.0 on Windows 8.1 64 bit (Update 2015.6)

Installing Theano is a pain in the ass if it is on Windows 8.1. Here is the breakdown of how to install it on my Windows 8.1 64bit machine: 1. Install Python 2.7.x: https://www.python.org/downloads/ 2. Install MinGW64: http://sourceforge.net/projects/mingw-w64/. After the installation of MinGW64, add `install_path_to_mingw64/bin` to your `PATH` variable. A caveat is to put the path at …

How to run JupyterHub on Ubuntu?

JupyterHub is an Ipython notebook extension which supports multi-user logins. (https://github.com/jupyter/jupyterhub). Installation of JupyterHub, however, requires a bit work due to their incomplete docs and complicated dependencies. Here are the steps I went through to run JupyterHub on my Ubuntu machine: 1. Set alias. JupyerHub will use Python 3.x instead of Python 2.7. But Ubuntu …

How to convert Matlab variables to numpy variables?

Background If you have a Matlab variable, say a matrix, that you want to read in Python. How will you do that? In this post, I am introducing a way that works 100%. 1. Save Matlab variable(s) to ‘.mat’ file. save(‘your_file_name.mat’, ‘first_var’, ‘second_var’,…) 2.  In Python, load ‘.mat’ file using `scipy.io`. import scipy.io scipy.io.loadmat(‘your_file_name.mat’) References: …

Compile Cython Module on Windows

In this post, I am showing how to compile Cython modules on Windows, which often leads to weird error messages. (Cython references: http://cython.org/, http://docs.cython.org/index.html, https://github.com/cython/cython) 1. You should already have correct structure to hold your “.pyx” file. Also, `setup.py` needs to be correctly configured. The following shows an example of `setup.py`: try: from setuptools import …

Life saving tips for PyDev

I wrote a very useful post a year ago, talking about 20 life-saving tips in Eclipse: http://maider.blog.sohu.com/281903297.html. In that context, the tips focus more on efficiency during Java development. In this post, several tips particularly useful for Python developers are collected. I will continue updating the post whenever I find something useful. 1. Press `F2` …