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 sys | |
from random import randrange | |
if __name__ == "__main__": | |
while True: | |
print("Level: ", end="") | |
try: | |
level = int(input()) | |
except ValueError: | |
level = False |
import numpy as np | |
def weighted_quantile_type_7(a, q, weights=None, axis=None): | |
def _func_1d(arr, q, weights): | |
n = len(arr) | |
if weights is None: | |
weights = np.repeat(1 / n, n) | |
else: |
In [65]: import pandas as pd | |
In [66]: a = pd.DataFrame({'hru': [9, 10, 10], 'sub': [100, 100, 100], 'down': [-1, 200, -1]}) | |
In [67]: a | |
Out[67]: | |
hru sub down | |
0 9 100 -1 | |
1 10 100 200 | |
2 10 100 -1 |
import sqlalchemy as db | |
from sqlalchemy import Table, Column, Integer, String, ForeignKey | |
from sqlalchemy.orm import relationship | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
Base = declarative_base() | |
engine = db.create_engine("sqlite:///toto.db", echo=True) |
from flinks import Client | |
CUSTOMER_ID = 'secret!!' | |
BASE_URL = 'secret!!' | |
DEMO_USER = 'Greatday' | |
DEMO_PW = 'Everyday' | |
DEMO_INST = 'FlinksCapital' | |
QUESTIONS = { | |
'What city were you born in?': 'Montreal', | |
'What is the best country on earth?': 'Canada', |
from flask import Flask, send_file | |
from io import BytesIO | |
app = Flask(__name__) | |
@app.route('/get_placements') | |
def get_placements(): | |
placements = '<Placemark>bla</Placemark>' # replace with your own placement creation logic | |
f = BytesIO() # memory buffer, acting as a file | |
# f-strings are new in py3.6+ |
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): |