- $ (e.g., $4) represents columns, @ (e.g., @2) represents rows.
- $> means the last column.
Last row sum of all above:
Last row sum of all above:
/* | |
- 2021-09-24 Received this from He | |
*/ | |
with elasticity_xp as | |
(select | |
msg.load_uuid | |
, max_by(msg.elasticity_experiment.pre_xp_price, ts) as pre_xp_price | |
, max_by(msg.elasticity_experiment.post_xp_price, ts) as post_xp_price | |
, max_by(msg.elasticity_experiment.perturbation_factor, ts) as perturbation_factor |
# test partial | |
from functools import partial | |
def frozen_func(): | |
return 2 | |
def target_func(x, frozen_func): |
numpy.seterr(all='raise') |
from IPython.display import display |
import datetime | |
# get UTC timestamp in seconds | |
datetime_utc_origin = datetime.datetime(1970, 1, 1) | |
# now | |
utc_timestamp_now = (datetime.datetime.utcnow() - datetime_utc_origin).total_seconds() |
import math | |
n = 33 # number of questions | |
r = 6 # number of correct answers | |
probs = [] | |
for r in range(n): |
# specify time frequency of groupby | |
groupby_freq = 'W' | |
gr = df.groupby( | |
pd.Grouper(key='date', freq=groupby_freq) | |
) |
# 2021-06-09 This is older way | |
import matplotlib.pyplot as plt | |
def plot_bar_chart_interaction( | |
means_var1_low, | |
means_var1_high, | |
var1_name="", | |
var2_name="", | |
title="", |
def color_large_value_red(val): | |
""" | |
Takes a scalar and returns a string with | |
the css property `'color: red'` for absolute values > 0.5, | |
black otherwise. | |
""" | |
try: | |
float_val = float(val) | |
color = 'red' if (abs(float_val) > 0.4) and (float_val != 1) else 'black' |