This file contains hidden or 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(ggplot2) | |
library(dplyr) | |
prob_per_trial = function(x){ | |
p_ori = 0.02 | |
p_add = 0.02 | |
if (x==0){ | |
return(1) | |
}else if (x<=50){ | |
return(p_ori) |
This file contains hidden or 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
x1 = c(0,1500,500,500) | |
y1 = c(0,975,470,475) | |
x2 = c(0,500,1500,500) | |
y2 = c(0,315,1365,460) | |
df_patients = data.frame( | |
patient_1 = x1, | |
cure_1 = y1, | |
patient_2 = x2, | |
cure_2 = y2 |
This file contains hidden or 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
# 2020-4-26编码,将三个文件处理以后合并成一个excel | |
import os | |
import pandas as pd | |
import re | |
# 从第三行开始,第一列医生名称,第二列进修生带教数量,第三列规陪数量,第四列月份,第五列年份 | |
xl_file_path = os.path.join('datafile','summary.xlsx') | |
df = pd.read_excel(xl_file_path) | |
#原始表其实是两个表格的联合,先拆成basic和detail两个表 |
This file contains hidden or 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
from faker import Faker | |
import pandas as pd | |
import os | |
fk = Faker('zh_CN') | |
class PtRecord: | |
def __init__(self,fk): |
This file contains hidden or 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 requests | |
import os | |
import xml.etree.ElementTree as ET | |
import pyperclip | |
import argparse | |
import re | |
reLink = re.compile(r'https://www.ncbi.nlm.nih.gov/pubmed/(\d+)') | |
parser = argparse.ArgumentParser( | |
"-i pmid -l pubmed link") | |
parser.add_argument('-i') |