Skip to content

Instantly share code, notes, and snippets.

View hgfernan's full-sized avatar

Hilton Fernandes hgfernan

  • S. Paulo, Brazil
  • 04:19 (UTC -12:00)
View GitHub Profile
import pandas as pd
import numpy as np
from scalecast.Forecaster import Forecaster
from pmdarima import auto_arima
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(rc={'figure.figsize':(14,7)})
df = pd.read_csv('AirPassengers.csv')
f = Forecaster(y=df['#Passengers'],current_dates=df['Month'])
@schochastics
schochastics / yt_rstudio.R
Last active February 1, 2024 13:55
Play youtube videos in Rstudio viewer pane
library(shiny)
xy <- c(784,479) #output of grDevices::dev.size("px")
url <- "https://www.youtube.com/watch?v=Ef2jmf2vy00" #copy yt link here
url <- gsub("watch\\?v=","embed/",url)
ui <- fluidPage(
HTML(paste0('<iframe width="',xy[1],'" height="',xy[2],'" src="',url,'" frameborder="0"></iframe>'))
)
server <- function(input, output, session) {
}
@suissa
suissa / groupBy.js
Last active July 15, 2024 20:48
Group by bem facinho
const groupBy = (xs, key) => xs.reduce((rv, x) => ({
...rv, [x[key]]: [...(rv[x[key]] || []), x]
}), {});