Skip to content

Instantly share code, notes, and snippets.

""" Output:
T Efficiency
100 1.6
200 5.4
300 7.8
400 9.6
500 11.0
600 12.2
700 13.1
"""
# download https://github.com/Basistiy/duma/blob/master/data/edata.csv
from collections import Counter
import matplotlib.pyplot as plt
lines = open('edata.csv').readlines()[1:]
lines = [i.strip() for i in lines]
totals = [int(i.split(',')[-4]) for i in lines]
ers = [int(i.split(',')[-5]) for i in lines]
rats = [b/a*100 for a, b in zip(totals, ers) if a>0]
from matplotlib import pyplot
@vashu1
vashu1 / gist:ab03056131bd6cdc1f410583a4355d3b
Created October 13, 2021 00:21
stabilisation efficiency
ssm = 100
S = ssm / (100**2)
sr = 0.03+math.sqrt(ssm)/2/100
r = 0.03
m = 0.3
reff=r/2*3
import math
@vashu1
vashu1 / gist:bfd8ffd0942022918120813ebe0aac77
Created May 3, 2021 22:32
global_warming_real_data_simulated_error
import os
import functools
import operator
from datetime import datetime
from collections import defaultdict
import random
import numpy as np
DATE_FILTER_PATTERN = ' 12:00"' # take noon data
CSVS_FOLDER = 'csvs'
import random
import math
random.seed(1) # to make reproducible results
def rand(): # +/- 10
return (random.random() - 0.5) * 20
def avg(lst):
return sum(lst) / len(lst)