This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Print a FITS header or keyword. Type imhead.py -h for help. | |
Requires pyfits. | |
Author | |
------ | |
@jiffyclub | |
git.io/jiffyclub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This code is for part one the AI Class optional Natural Language Processing | |
programming assignment. See youtu.be/KuSg1wcty3s for the complete problem | |
definition. | |
We are given a string which has been encoded with a Caesar cipher: | |
http://en.wikipedia.org/wiki/Caesar_cipher, and our job is to decode it. | |
You could do this by brute force, simply print out each shift of the letters | |
and look for the correct one by eye. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This code is for part two of the AI Class optional Natural Language Processing | |
programming assignment. See youtu.be/KuSg1wcty3s for the complete problem | |
definition. | |
We are given a sentence that spans several lines and has been shredded | |
vertically so that there are 2 characters in each column. The columns are | |
arranged in random order and it's our job to assemble them into the correct | |
order. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This code is for part two of the AI Class optional Natural Language Processing | |
programming assignment. See youtu.be/KuSg1wcty3s for the complete problem | |
definition. | |
We are given a sentence that spans several lines and has been shredded | |
vertically so that there are 2 characters in each column. The columns are | |
arranged in random order and it's our job to assemble them into the correct | |
order. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Check helmet test data for Software Carpentry. | |
""" | |
import sys | |
from collections import namedtuple | |
HelmetTest = namedtuple('HelmetTest', ['temp', 'time', 'brittle']) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YEAR,AUS Temp,CAN Temp | |
1901,21.357021,-7.672419 | |
1902,21.382462,-7.862711 | |
1903,20.936884,-7.910783 | |
1904,20.791357,-8.155729 | |
1905,20.954510,-7.547311 | |
1906,21.767315,-7.684103 | |
1907,21.051441,-8.413553 | |
1908,20.649048,-7.790929 | |
1909,20.812077,-8.239306 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def fuzzy_between(val, minval, maxval, fuzz=2, inclusive=True): | |
""" | |
Test whether a value is within some range with some fuzziness at the edges | |
to allow for floating point noise. | |
The fuzziness is implemented by expanding the range at each end `fuzz` steps | |
using the numpy.nextafter function. For example, with the inputs | |
minval = 1, maxval = 2, and fuzz = 2; the range would be expanded to |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.