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
ENTITY book_lines | |
{ | |
int book_line_id, | |
string line, | |
int source, | |
int linenum, | |
int created_at, | |
int updated_at | |
PRIMARY(linenum, source) | |
} |
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 | |
import itertools as it | |
def normalize(x): | |
return x / np.sum(x) | |
def normalizerow(x): | |
return (x.T / np.sum(x, axis=1)).T | |
def normalizecol(x): |