Skip to content

Instantly share code, notes, and snippets.

Avatar

Behrouz B. behrouz-bakhtiari

View GitHub Profile
View pval.py
import scipy.stats, math
mu = 8000
xbar = 8100
s = 580
n = 40
t_dist = scipy.stats.t(n-1)
t = (xbar - mu)/(s/math.sqrt(n))
pval = 1 - t_dist.cdf(t)
View 10000_samples.py
import numpy as np
import seaborn as sns
samples = np.zeros(10000)
mu, sigma = 20, 3
for s in range(10000):
sample = np.random.normal(mu, sigma, 250) #sample of size 250
x_bar = sample.mean() #calculating sample mean
samples[s] = x_bar
sns.distplot(samples, hist = True, color = 'darkblue',
hist_kws={'edgecolor':'black'}).set(xlabel = 'Sample Mean',
View sample_normal.py
import numpy as np
mu, sigma = 20, 3
sample = np.random.normal(mu, sigma, 250)
x_bar = sample.mean()
View A hack for showing LaTeX formulas in GitHub markdown.md

Problem

A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.

Investigation

@behrouz-bakhtiari
behrouz-bakhtiari / README-Template.md
Created Jun 9, 2018 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You can’t perform that action at this time.