Skip to content

Instantly share code, notes, and snippets.

@VolkerH
VolkerH / PY-CircleFitting.ipynb
Created March 29, 2023 11:21 — forked from WetHat/PY-CircleFitting.ipynb
Fitting a Circle to a 2d Point Cloud by Linear Least Squares
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@VolkerH
VolkerH / pprint_numpy.py
Created September 5, 2023 14:51 — forked from eric-wieser/pprint_numpy.py
A super janky example of how _repr_html_ could be implemented
import numpy as np
def _html_repr_helper(contents, index=()):
dims_left = contents.ndim - len(index)
if dims_left == 0:
s = contents[index]
else:
s = ''.join(_html_repr_helper(contents, index + (i,)) for i in range(contents.shape[len(index)]))
return "<div class='numpy-array-ndim-{} numpy-array-ndim-m{}' title='[{}]'>{}</div>".format(