How to split a file in two on even/odd line numbers
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…
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:
This is how you can get started successfully using Git. Basic concepts: Git Tutorial (by Lars Vogel) how successful developers are using Git:A successful branching model for Git (Gitflow) Online books: Pro Git and Git Community Book Additional things to…
This table lists the number of total tiles for increasing zoom-level in a tile cache. The tile cache is assumed to be pyramidal: . level 1: 1 tile level 2: 5 tiles level 3: 21 tiles level 4: 85 tiles…
Plotting data in LaTeX is a useful thing to do. Xavier Delaunay shows how to do it on his homepage: The plot looks like this: