| Soleil/Pluie | non | oui | total |
|---|---|---|---|
| oui | 75 | 2 | 77 |
| non | 10 | 13 | 23 |
| total | 85 | 15 | 100 |
Il fait soleil 77% du temps, et il pleut 15% du temps (les deux ne sont pas mutuellement exclusifs).
| import numpy as np | |
| import tensorflow as tf | |
| N = 5 | |
| M = tf.constant(np.arange(N * N).reshape((N, N)), dtype=tf.int32) # N x N tensor, with values from 0 to N-1 | |
| # This code implements a fully differentiable summation of all the elements of M where i != j | |
| # inner loop, on columns | |
| def body(i, r): |
| >>> words = "L’organisme ou la forme peut etre desintegres sin on en fait un emploi occulte".split() | |
| >>> words | |
| ['L’organisme', 'ou', 'la', 'forme', 'peut', 'etre', 'desintegres', 'sin', 'on', 'en', 'fait', 'un', 'emploi', 'occulte'] | |
| >>> n_words = len(words) | |
| >>> left = words[:n_words//2] | |
| >>> left | |
| ['L’organisme', 'ou', 'la', 'forme', 'peut', 'etre', 'desintegres'] | |
| >>> right = words[n_words//2:] | |
| >>> right | |
| ['sin', 'on', 'en', 'fait', 'un', 'emploi', 'occulte'] |
| <?xml version="1.0" encoding="utf-8"?> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
| <head> | |
| <title>iclr_data</title> | |
| <!-- 2018-02-08 Thu 15:54 --> | |
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
| <meta name="generator" content="Org-mode" /> | |
| <meta name="author" content="Christian Jauvin" /> |
| #!/usr/bin/env python | |
| import datetime as dt | |
| import json | |
| import os | |
| N_PER_BOX = 30 | |
| path = os.path.dirname(os.path.realpath(__file__)) |
| def intersect(cur, sn1, sn2, sdr, inter_table): | |
| sn1_field = STREETNAME_FIELD | |
| if isinstance(sn1, int): | |
| sn1_field = 'norte' | |
| sn2_field = STREETNAME_FIELD | |
| if isinstance(sn2, int): | |
| sn2_field = 'norte' | |
| q = """ |
| {0,1,2,3} {} {} | |||
| {0,1,2} {} {} | |||
| {0,1} {} {} | |||
| {0,1,2,3} {} {} -> {1,2,3} {0} {} | |||
| {0} {} {} -> {} {0} {} | |||
|---|---|---|---|
| from collections import Counter, defaultdict | |
| import numpy as np | |
| N = 45 | |
| K = 1350 | |
| #K = 10 | |
| goal = (31, 39) # (7, 4) | |
| #goal = (7, 4) | |
| G = np.zeros((N, N)) # [y][x] |
| from collections import defaultdict | |
| import re | |
| bot_values = defaultdict(list) # bot i -> list of values | |
| bins = {} | |
| s = """value 5 goes to bot 2 | |
| bot 2 gives low to bot 1 and high to bot 0 | |
| value 3 goes to bot 1 |