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 string | |
from pandas import DataFrame | |
import numpy as np | |
from numpy.random import randn | |
import pandas.tools.plotting as plotting | |
from matplotlib.pylab import close |
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 squarify | |
import matplotlib.pyplot as plt | |
from numpy.random import rand | |
fig, axes = plt.subplots(2, 3, figsize=(14, 8)) | |
plt.subplots_adjust(top=0.95, bottom=0.05, left=0.05, right=0.95, hspace=0.35) | |
sq = 8 | |
def random_colors(n): |
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 string | |
from pandas import DataFrame | |
import numpy as np | |
from numpy.random import randn, rand | |
import pandas.tools.plotting as plotting | |
from matplotlib.pylab import close |
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
from pandas import Series, DataFrame | |
import numpy as np | |
from numpy.random import randn, rand | |
import pandas.tools.plotting as plotting | |
import matplotlib.pyplot as plt | |
s = Series(randn(6), index=range(6)) |
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
from pandas import DataFrame, Series | |
from numpy.random import randn, rand | |
df1 = DataFrame(randn(6, 3), index=range(6), | |
columns=['a', 'b', 'c']) | |
df2 = DataFrame(randn(6, 3), index=range(6), | |
columns=['d', 'e', 'f']) | |
df3 = DataFrame(randn(6, 3), index=range(6), |
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 string | |
from pandas import DataFrame, Series | |
from numpy.random import randn | |
import matplotlib.pyplot as plt | |
df = DataFrame(randn(7, 4), | |
index=list(string.ascii_letters[:7]), | |
columns=['x', 'y', 'z', 'four']) | |
series = Series(randn(7), index=range(7)) |
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
# -*- coding: utf-8 -*- | |
import string | |
from pandas import DataFrame, Series | |
import datetime | |
import numpy as np | |
from numpy.random import randn, rand | |
import pandas.tools.plotting as plotting | |
from pandas.compat import u, string_types |
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 pandas as pd | |
import numpy as np | |
import pandas.util.testing as tm | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import numpy as np | |
series = pd.Series(3 * np.random.rand(4), index=['a', 'b', 'c', 'd'], name='series') |
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(forecast) | |
library(ggplot2) | |
d <- AirPassengers | |
d.arima <- forecast::auto.arima(d) | |
d.forecast <- forecast(d.arima, level = c(95), h = 50) | |
fortify.forecast <- function(forecast.data) { | |
require(dplyr) | |
forecasted <- as.data.frame(forecast.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
library(survival) | |
library(ggplot2) | |
library(scales) | |
d.survfit <- survival::survfit(survival::Surv(time, status) ~ sex, | |
data = lung) | |
fortify.survfit <- function(survfit.data) { | |
data.frame(time = survfit.data$time, |
OlderNewer