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
from math import exp | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def sigmoid(x): | |
return 1.0 / (1.0 + exp(-x)) | |
def implication(a, b): |
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.
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
from collections import Counter | |
from nltk.corpus import brown | |
from pytagcloud import create_tag_image, make_tags | |
from PIL import Image | |
# Developed from https://pypi.python.org/pypi/pytagcloud | |
create_tag_image(make_tags(Counter(brown.words()).most_common(150), maxsize=300), 'cloud.png', size=(900, 600), fontname='Lobster') | |
Image.open('cloud.png').show() |
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
s = u"""DTU course 02819 is taught by Mr. Finn Årup Nielsen, | |
Ph.D. Some of aspects of the course are: machine learning and web | |
2.0. The telephone to Finn is (+45) 4525 3921, and his email is | |
faan@dtu.dk. A book published by O'Reilly called 'Programming | |
Collective Intelligence' might be useful. It costs $39.99 or 285.00 | |
kroner in Polyteknisk Boghandle. Is 'Text Processing in Python' | |
appropriate for the course? Perhaps! The constructor function in | |
Python is called "__init__()". fMRI will not be a topic of the | |
course.""" |
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.
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
wget https://dumps.wikimedia.org/other/pagecounts-all-sites/2015/2015-05/pagecounts-20150501-000000.gz | |
gzip -cd pagecounts-20150501-000000.gz | grep "^da " | perl -anle "print @F[2] . ' ' . @F[1] unless @F[1] =~ /(Bruger|Brugerdiskussion|da|Diskussion|Fil|Hj\%C3\%A6lp|Hj\%C3\%A6lp-diskussion|Kategori|Kategoridiskussion|MediaWiki|Portal|Skabelon|Skabelondiskussion|Speciel|Wikipedia|Wikipedia-diskussion):/i" | sort -nr | less |
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
# https://github.com/fnielsen/everything | |
from everything import * | |
import pyfftw.interfaces.scipy_fftpack | |
def is_prime(n): | |
"""https://stackoverflow.com/questions/18833759/""" | |
if n % 2 == 0 and n > 2: | |
return False |
OlderNewer