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
Rank | Country | GDP (millions of Int$) | |
---|---|---|---|
World | 119,097,427 | ||
1 | China | 21,269,017 | |
— | European Union[n 1] | 19,973,035 | |
2 | United States | 18,561,934 | |
3 | India | 8,720,514 | |
4 | Japan | 4,931,877 | |
5 | Germany | 3,979,083 | |
6 | Russia | 3,745,084 | |
7 | Brazil | 3,134,892 |
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
# Michael A. Alcorn ([email protected]) | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import seaborn as sns | |
import numpy as np | |
import statsmodels.api as sm # recommended import according to the docs | |
import matplotlib.pyplot as plt |
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
# Michael A. Alcorn ([email protected]) | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import seaborn as sns | |
import random | |
fixed_rates = {"p_1": 0.3, "p_2": 0.5} | |
find_rates = {"biased": {"fixed": 0.7, "non_fixed": 0.9}, |
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
kernels = model.layers[0].get_weights()[0].T | |
(rows, cols) = (8, 4) | |
plt.figure(figsize = (16, 24)) | |
gs = gridspec.GridSpec(rows, cols, wspace = 0.1, hspace = 0.1) | |
for i in range(kernels.shape[0]): | |
row = i // cols | |
col = i % cols | |
ax = plt.subplot(gs[row, col]) |
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 matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
from keras import backend | |
from keras.layers import Input, Dense | |
from keras.models import Model | |
# Autoencoder. |
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
# Michael A. Alcorn | |
import matplotlib | |
matplotlib.use("Agg") | |
import matplotlib.pyplot as plt | |
import multiprocessing | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
import time |
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
# Michael A. Alcorn | |
from Bio import Phylo | |
tree = Phylo.read("species_newick.txt", "newick") | |
clade_counts = {} | |
for clade in tree.find_clades(): | |
if not clade.is_terminal(): | |
clade_counts[str(clade)] = clade.count_terminals() |
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
# Michael A. Alcorn | |
library(ggplot2) | |
library(plyr) | |
data <- read.csv("species.csv") | |
data$Date <- as.Date(data$Date, "%Y-%m-%d") | |
ggplot(data, aes(Date, Total)) + geom_line() + scale_x_date(date_breaks = "1 month") |
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
# Michael A. Alcorn | |
import torch | |
import torch.autograd as autograd | |
import torch.nn as nn | |
def create_lstm(params): | |
"""Create a LSTM from a dictionary of parameters. |
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
# Michael A. Alcorn | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
df = pd.read_csv("repdata.tab", sep = "\t", index_col = False) | |
no_law = set(df[df["RTW"] == 0]["state"]) | |
yes_law = set(df[df["RTW"] == 1]["state"]) | |
states_that_changed = list(no_law & yes_law) | |
states_that_changed.sort() |
OlderNewer