This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Procedure to scrape a table from wikipedia using python. Uses MediaWikiAPI to get page content. | |
Allows for cells spanning multiple rows and/or columns. Outputs a Pandas dataframe. | |
Page used for testing (second table in particular): | |
https://en.wikipedia.org/wiki/International_Phonetic_Alphabet_chart_for_English_dialects | |
""" | |
import pandas as pd |
This file contains hidden or 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
#include <Python.h> | |
#include <numpy/arrayobject.h> | |
#include "chi2.h" | |
/* Docstrings */ | |
static char module_docstring[] = | |
"This module provides an interface for calculating chi-squared using C."; | |
static char chi2_docstring[] = | |
"Calculate the chi-squared of some data given a model."; |
This file contains hidden or 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 python3 | |
# -*- coding: utf-8 -*- | |
from __future__ import (division, absolute_import, print_function, unicode_literals) | |
import sys, os, argparse, time | |
from bs4 import BeautifulSoup | |
# from: https://stackoverflow.com/a/16518224/6332373 | |
if sys.version_info >= (3,): | |
import urllib.request as urllib2 | |
import urllib.parse as urlparse |