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 datetime | |
from functools import singledispatch | |
stem = "甲乙丙丁戊己庚辛壬癸" | |
branch = "子丑寅卯辰巳午未申酉戌亥" | |
@singledispatch | |
def stembranch(year): | |
return stem[(year - 4) % 10] + branch[(year - 4) % 12] |
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 datetime import date | |
stem = "甲乙丙丁戊己庚辛壬癸" | |
branch = "子丑寅卯辰巳午未申酉戌亥" | |
ZODIAC = "鼠牛虎兔龙蛇马羊猴鸡狗猪" | |
STEMBRANCH = ( | |
'甲子', '乙丑', '丙寅', '丁卯', '戊辰', '己巳', '庚午', '辛未', '壬申', '癸酉', '甲戌', '乙亥', '丙子', '丁丑', | |
'戊寅', '己卯', '庚辰', '辛巳', '壬午', '癸未', '甲申', '乙酉', '丙戌', '丁亥', '戊子', '己丑', '庚寅', '辛卯', | |
'壬辰', '癸巳', '甲午', '乙未', '丙申', '丁酉', '戊戌', '己亥', '庚子', '辛丑', '壬寅', '癸卯', '甲辰', '乙巳', | |
'丙午', '丁未', '戊申', '己酉', '庚戌', '辛亥', '壬子', '癸丑', '甲寅', '乙卯', '丙辰', '丁巳', '戊午', '己未', |
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 collections import Counter | |
from pprint import pprint | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import plotly.express as px | |
import seaborn as sns | |
from Bio import Medline | |
journal = [] |
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
ggplot(data=global500)+stat_count(mapping = aes(y=Country)) | |
ggplot(data=global500)+stat_count(mapping = aes(Country)) | |
ggplot(data=global500)+stat_boxplot(mapping = aes(Country, Revenue)) | |
ggplot(data=global500)+stat_boxplot(mapping = aes(y=Country, Revenue)) |
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 collections import Counter | |
import pandas as pd | |
import plotly.express as px | |
from Bio import Entrez, SeqIO | |
Entrez.api_key = "" | |
Entrez.email = "" | |
term = 'TMPRSS6[GENE] AND "refseq select"[filter] AND human[organism]' | |
handle = Entrez.esearch(db="protein", term=term) |
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
#include <stdio.h> | |
int main() { | |
char *stem[] = {"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"}; | |
char *branch[] = {"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"}; | |
int i = 0; | |
while (i < 60) { | |
printf("%s%s\n", stem[i%10], branch[i%12]); | |
i++; | |
} |
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
#include <stdio.h> | |
void stembranch(int year) { | |
char *stem[] = {"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"}; | |
char *branch[] = {"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"}; | |
printf("%s%s\n", stem[(year - 4) % 10], branch[(year - 4) % 12]); | |
} | |
int main() { | |
int year; |
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
stem <- c("甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸") | |
branch <- c("子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥") | |
stembranch <- function(year) { | |
return(paste0(stem[(year-3)%%10], branch[(year-3)%%12])) | |
} |
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
public class StemBranch { | |
public static String stemBranch(int year) { | |
String[] stem = {"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"}; | |
String[] branch = {"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"}; | |
return stem[(year - 4) % 10] + branch[(year - 4) % 12]; | |
} | |
public static boolean leap(int year) { | |
if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) { | |
return true; |
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 itertools | |
for i, j, k in itertools.product("ATCG", "ATCG", "ATCG"): | |
print(i + j + k) |
NewerOlder