Index ¦ Archives ¦ Atom > Tag: pandas

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 …

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