This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.", | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fullmodel <- lm(data=df, CHD ~ Smoking+Fat+Exercise+Age+(1|ID)) | |
print(fullmodel) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model <- lm(data=df, CHD ~ Smoking) | |
print(model) | |
summary(model)$sigma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
J = 0.001*((np.mean(df['Glucose'])+np.std(df['Glucose']))**2) | |
GMI = 3.31 + (0.02392*np.mean(df['Glucose'])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(intradaysd_mean) | |
print(interdaysd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |