Skip to content

Tag: python

Altering an Enum field using Alembic

How can I add an element to an Enum field in an alembic migration when using a version of PostgreSQL older than 9.1 (which adds the ALTER TYPE for enums)? This SO question explains the direct process, but I’m not quite sure how best to translate that using alembic. This is what I have: The above unfortu…

Matplotlib discrete colorbar

I am trying to make a discrete colorbar for a scatterplot in matplotlib I have my x, y data and for each point an integer tag value which I want to be represented with a unique colour, e.g. typically tag will be an integer ranging from 0-20, but the exact range may change so far I have just used the

Missing files for `magic` library on Windows

I need to get mime type for some files on windows, so i’ve installed python-magic (on 32-bit python 2.7.3). It depends on unix magic library. Author instructs to get regex2.dll, zlib1.dll and magic1.dll from gnuwin32 project. So i saved the files to a folder and added the folder to my system PATH. Now w…