Skip to content

Instantly share code, notes, and snippets.

View theref's full-sized avatar

James Campbell theref

View GitHub Profile
@theref
theref / keybase.md
Created December 18, 2023 10:23
Proof of Github ownership for keybase

Keybase proof

I hereby claim:

  • I am theref on github.
  • I am theref (https://keybase.io/theref) on keybase.
  • I have a public key ASC2iRr-MzYQ-hTYDRcroAdWp1YT8WmMhOJ3zLyrpn5jmgo

To claim this, I am signing this object:

@theref
theref / SupportVectors.csv
Created April 13, 2017 18:11
Files for recreating Model
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 12 columns, instead of 5. in line 3.
9.997071456462316430e-01,9.037037037037035647e-01,9.954559224477431689e-01,9.969145169448659916e-01,9.932053055449441281e-01,8.949602756685833826e-01,3.703893399164404077e-01,1.473877554496822451e-01,9.972417728742628551e-01,1.000000000000000000e+00,9.961193630402783716e-01,1.000000000000000000e+00
9.969820872274139933e-01,9.384615384615383471e-01,9.927294759163888260e-01,9.951024941936791324e-01,9.737574910474540157e-01,9.627588053722183625e-01,5.251680775655865885e-01,2.921607508915338158e-01,9.955374097987084170e-01,1.000000000000000000e+00,9.959520942058077697e-01,1.000000000000000000e+00
9.984413054067213800e-01,9.064748201438843633e-01,9.985834977487727526e-01,9.964574898785419910e-01,9.427571333780020435e-01,6.464041564137210649e-01,7.057332265808172744e-01,4.684933018342491984e-01,9.960163141420848021e-01,1.000000000000000000e+00,9.994979415603976181e-01,1.000000000000000000e+00
9.993170065372235511e-01,9.843749999999994449e-01,9.974733437768456001e-01,9.976214574898784049e-01,9.741340327610608085e-01
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theref
theref / pandas_hints.py
Created March 21, 2017 09:55
A list of useful pandas stuff that I found online
# List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]

The seven rules of a great git commit message

Keep in mind: This has all been said before.

  • Separate subject from body with a blank line
  • Limit the subject line to 50 characters
  • Capitalize the subject line
  • Do not end the subject line with a period
  • Use the imperative mood in the subject line ie, complete the sentence If applied this commit will...
  • Wrap the body at 72 characters
  • Use the body to explain what and why vs. how
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theref
theref / fingerprint.ipynb
Created November 4, 2016 10:19
Fingerprint Class example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theref
theref / colour_map.ipynb
Created November 2, 2016 09:22
Colour maps to reproduce Ashlock Fingerprint
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.