The backend returns some optional fields but you want to write a function that makes those optional fields nullable. Why? No apperent reason.
type Response = {
name: string;
age?: number;
Date | Temp | |
---|---|---|
1981-01-01 | 20.7 | |
1981-01-02 | 17.9 | |
1981-01-03 | 18.8 | |
1981-01-04 | 14.6 | |
1981-01-05 | 15.8 | |
1981-01-06 | 15.8 | |
1981-01-07 | 15.8 | |
1981-01-08 | 17.4 | |
1981-01-09 | 21.8 |
\documentclass{article} | |
\usepackage{fancyhdr} | |
\usepackage{extramarks} | |
\usepackage{amsmath} | |
\usepackage{amsthm} | |
\usepackage{amsfonts} | |
\usepackage{tikz} | |
\usepackage[plain]{algorithm} | |
\usepackage{algpseudocode} |
using Distributions, Random, StatsBase | |
ρ = 0.7 | |
σ = 1 | |
μ = 0 | |
σ_y = σ / √(1 - ρ^2) | |
N = 10_000_000 |
function U(n, x) | |
if n == 0 return 0 end | |
if n == 1 return x end | |
return 2 * x * U(n - 1, x) - U(n - 2, x) | |
end | |
space = collect(range(0, 1, length=200)) | |
plot(dpi=1000, legend=false, xaxis=false, yaxis=false, ticks=false) |
# Author: Gabriela Miyazato Szini and Andrea Titton - March 2021 | |
import numpy as np | |
from itertools import permutations, combinations | |
np.random.seed(110792) | |
verbose = True | |
# Initialization |
function annotatewithbox!( | |
fig::Plots.Plot, | |
text::Plots.PlotText, | |
x::Real, y::Real, Δx::Real, Δy::Real = Δx; | |
kwargs...) | |
box = Plots.Shape(:rect) | |
Plots.scale!(box, Δx, Δy) | |
Plots.translate!(box, x, y) |
using DelimitedFiles, Base.Iterators | |
alphabet = 'A':'Z' | |
n = length(alphabet) | |
alphabetdict = Dict(alphabet .=> 1:n) | |
function parsepair(str::String) | |
clean = strip(str, [' ', '|']) | |
l, r = only.(split(clean, "")) | |
begin | |
function plotvectorfield(xs, ys, g::Function; plotkwargs...) | |
fig = plot() | |
plotvectorfield!(fig, xs, ys, g; plotkwargs...) | |
return fig | |
end | |
function plotvectorfield!(figure, xs, ys, g::Function; rescale = 1, plotkwargs...) | |
xlims = extrema(xs) |