Skip to content

Instantly share code, notes, and snippets.

View brinnaebent's full-sized avatar

RunsData brinnaebent

View GitHub Profile
import os
import openai
openai.api_key = 'OPEN_AI_API_KEY'
response = openai.Edit.create(
model="text-davinci-edit-001",
input="Meeting Notes\n1/30/23\nIn attendance: Bob, Chip\nBob's 3 point plan - 1. Build cool stuff 2, work with Awesome people 3, eat lots of pizza Tasks for Bob - • Write blog\nEdit blog\n• Order a Pizza\nbob favorite pizza toppings: • pineapple\n8 ham\n•mushroms\n",
instruction="Fix the grammar and format as Markdown.",
)
fullmodel <- lm(data=df, CHD ~ Smoking+Fat+Exercise+Age+(1|ID))
print(fullmodel)
model <- lm(data=df, CHD ~ Smoking)
print(model)
summary(model)$sigma
library(lme4)
plot(df$Smoking, df$CHD, xlab='Average Cigarrettes per Adult per Day', ylab="Coronary Heart Disease Mortality (per 10k)")
abline(lm(data=df, CHD ~ Smoking ), col="red")
plot(df$ID, df$CHD)
plot(df$Age, df$CHD)
plot(df$Smoking, df$CHD)
plot(df$Fat, df$CHD)
plot(df$Exercise, df$CHD)
import cgmquantify as cgm
data = cgm.importdexcom('test_file.csv')
print('interdaysd is: ' + str(cgm.interdaysd(data)))
print('interdaycv is: ' + str(cgm.interdaycv(data)))
print('intradaysd is: ' + str(cgm.intradaysd(data)))
print('intradaycv is: ' + str(cgm.intradaycv(data)))
print('TOR is: ' + str(cgm.TOR(data)))
print('TIR is: ' + str(cgm.TIR(data)))
J = 0.001*((np.mean(df['Glucose'])+np.std(df['Glucose']))**2)
GMI = 3.31 + (0.02392*np.mean(df['Glucose']))
print(intradaysd_mean)
print(interdaysd)
# Standard Deviation over all days
interdaysd = np.std(df['Glucose'])
# Standard Deviation for each day
intradaysd =[]
for i in pd.unique(df['Day']):
intradaysd.append(np.std(df[df['Day']==i]))
# We can find the average intraday standard deviation:
meanG = np.nanmean(df['Glucose'])
medianG = np.nanmedian(df['Glucose'])
minG = np.nanmin(df['Glucose'])
maxG = np.nanmax(df['Glucose'])
Q1G = np.nanpercentile(df['Glucose'], 25)
Q3G = np.nanpercentile(df['Glucose'], 75)