Skip to content

Instantly share code, notes, and snippets.

View jiaweih's full-sized avatar

Jiawei He jiaweih

  • University of Washington
  • Seattle
View GitHub Profile
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Scalar"
]
},
{
{
"cells": [
{
"cell_type": "code",
"execution_count": 126,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
{
"cells": [
{
"cell_type": "code",
"execution_count": 72,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
{
"cells": [
{
"cell_type": "code",
"execution_count": 72,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
{
"cells": [
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
# Enter your code here. Read input from STDIN. Print output to STDOUT
import sys
import math
def get_std(lst):
length = len(lst)
summ = sum(lst)
average = reduce(lambda x, y: x + y, lst) / length
std = 0
import numpy as np
old_lst = [1,2,3]
old_std = round(np.std(old_lst),3)
N = []
for i in np.arange(0,50.0,0.0001):
new_lst = old_lst + [i]
new_std = np.std(new_lst)
if np.abs(new_std - old_std) < 0.0001:
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"> It is useful to have a single measure of exposure for each risk factor whether the risk is dichotomous, polytomous or continuous. This allows examination of trends in risk factors over time. An age-standardized version allows for comparison between places that highlights differences in exposure"
]
},
{
@jiaweih
jiaweih / yelp
Created December 16, 2015 06:45
simple yelp data exploration
{
"metadata": {
"name": "",
"signature": "sha256:6e4c856e61ed366e5407f7c52e4864977f273be5e7ec092e0c83c95d96e8a925"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [