Skip to content

Instantly share code, notes, and snippets.

View michaeldorman's full-sized avatar

Michael Dorman michaeldorman

View GitHub Profile
library(tidyverse)
library(wesanderson)
mean_steps <- read.csv("data.csv", stringsAsFactors = FALSE)
cols = c("#FF0000", "#00A08A", "#F2AD00")
cols2 = paste0(cols, "80")
cols = c(rbind(cols2, cols))
ggplot(data=mean_steps,aes(x = trial, y = mean_same, color = paste(block, actor))) +
stat_summary(fun="mean",position=position_dodge(width=0.1),
library(ggplot2)
library(sf)
# Prepare layer
dat = data.frame(
name = c("Beer-Sheva Center", "Beer-Sheva University", "Dimona"),
lon = c(34.79844, 34.81283, 35.01163),
lat = c(31.24329, 31.26028, 31.06862)
)
dat = st_as_sf(dat, coords = c("lon", "lat"), crs = 4326)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import pandas as pd
import geopandas as gpd
import rasterio
# numpy
a = np.array([3, 8, -2, 43, 12, 1, 8])
b = np.array([[1,2,3],[4,5,6],[7,8,9],[10,11,12]])
c = np.arange(1, 25).reshape((2, 3, 4))
m = np.array([[ np.nan, np.nan, np.nan, np.nan, np.nan, 3., 3.],
from selenium import webdriver
import time
driver = webdriver.Firefox()
# Loop
for i in range(1950, 2022):
for j in list(range(1, 12)):
# Variable selection
driver.get("https://ims.data.gov.il/he/ims/2")
time.sleep(3)
from selenium import webdriver
import time
driver = webdriver.Firefox()
# Loop
for i in range(1940, 1951):
for j in list(range(1, 12)):
# Variable selection
driver.get("https://ims.data.gov.il/he/ims/2")
time.sleep(3)