Index ¦ Archives ¦ Atom > Tag: python

Highlighting pandas .to_latex() output in bold face for extreme values

When preparing a table with experimental results for publication, one often wishes to highlight the output of extreme cells, for example by putting them in bold.

However, pandas does not readily support this use case. The closest one gets with stock pandas is table.style.highlight_max(axis=1) which highlights …


Affine transformations in python

Here is just a short note on how to do an affine transformation in python succinctly.

Code

import numpy as np
import matplotlib.pyplot as plt
data = np.ones((1000,3)) # needed for the transformation
data[:,0:2] = np.random.uniform(low=-1,high=1,size=(len(data),2)) # create …

Nice LaTeX plots with matplotlib

For my thesis I want the plots from jupyter notebook to integrate well with the rest of the LaTeX document. The article shows the settings necessary to achieve this look consistently by modifying the matplotlibrc. Using this approach the correct settings are always used and I can't forget them.

© Florian Kalinke. Built using Pelican. Theme by Giulio Fidente on github.