Cross platform benchmarking tools
VM benchmarking General benchmarking tools phoronix is a testing and benchmarking platform.
VM benchmarking General benchmarking tools phoronix is a testing and benchmarking platform.
So you have a list of tuples, created with the zip built-in function in Python. Like this: z = [(1, ‘a’), (2, ‘b’), (3, ‘c’)] And you want to reverse zip, to get these two lists: x = [1, 2,…
Given a numpy matrix (mixed_float_matrix) with a variety of float values, how do you convert it into a matrix, with zeros and ones (ones in place of non-zero values in the original matrix)?
I have a (CSV) file that I want to split in two. I want all the even lines to go to one file, and all the odd lines to go to another file. $ ls -1 FILE [MAGIC] $ ls…
Sometimes my head hurts from all the papers I have to read. All the lines of software I have to code. All the pages of high quality scientific output I have to write. All the people I have to impress.…
I’m learning about matplotlib, and actually just bought the book Matplotlib for Python Developers. Geographical plots Browsing stackoverflow, the matplotlib homepage, and other resources, I eventually came by this stackoverflow post, which mentions BaseMap. Since the data that I’m plotting…
I like to install 3rd party Python libraries using pip. Pip and easy_install can automatically download and install Python code from PyPi (also known as The Cheese Shop). This is how to publish your own Python code on PyPi, so…
Install SQLAlchemy This is easy (using pip): pip install sqlalchemy Learn SQLAlchemy This tutorial uses an in memory SQLite database, which is cool in itself. Various topics: Indexes
Why did I install gfortran? Well, not to write Fortran programs. I tried installing SciPy using pip install scipy, and I got a message that a Fortran compiler was needed. Install This is how I installed gfortran on my Mac:…
Here is an example of calling __init__() for all base classes, when doing multiple inheritance in Python (mixins). It uses *args and **kwargs syntax: