https://fonts.google.com/?selection.family=Open+Sans
cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip
| def enable_british_english(func): | |
| """ | |
| A simple decorator allowing users to provide British english | |
| arguments to functions and methods. | |
| Example: | |
| @enable_british_english | |
| def favourite(color=None): | |
| print(f"my favourite colour is {color}") |
| ngrams.tokenizer <- function(x, n = 2) { | |
| trim <- function(x) gsub("(^\\s+|\\s+$)", "", x) | |
| terms <- strsplit(trim(x), split = "\\s+")[[1]] | |
| ngrams <- vector() | |
| if (length(terms) >= n) { | |
| for (i in n:length(terms)) { | |
| ngram <- paste(terms[(i-n+1):i], collapse = " ") | |
| ngrams <- c(ngrams,ngram) | |
| } | |
| } |
| # By Jake VanderPlas | |
| # License: BSD-style | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| def discrete_cmap(N, base_cmap=None): | |
| """Create an N-bin discrete colormap from the specified input map""" |
| """making a dataframe""" | |
| df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB')) | |
| """quick way to create an interesting data frame to try things out""" | |
| df = pd.DataFrame(np.random.randn(5, 4), columns=['a', 'b', 'c', 'd']) | |
| """convert a dictionary into a DataFrame""" | |
| """make the keys into columns""" | |
| df = pd.DataFrame(dic, index=[0]) |
| #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."; |