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
rm(list = ls()) | |
library(dplyr) | |
df <- data_frame(y = rnorm(10,2), | |
x1 = as.factor(rbinom(10,1,0.5)), | |
x2 = as.factor(rep(letters[1:2],5))) | |
df | |
df %>% | |
add_count() %>% |
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(tidyverse) | |
(a <- data_frame(ID = 1:20, | |
D1 = sample(0:1,size = 20,replace = T,prob = c(0.8,0.2)), | |
D2 = sample(0:1,size = 20,replace = T,prob = c(0.7,0.3))) | |
) | |
(b <- data_frame(ID = 1:20, | |
D1 = sample(0:1,size = 20,replace = T,prob = c(0.9,0.1)), | |
D2 = sample(0:1,size = 20,replace = T,prob = c(0.9,0.1))) | |
) |
This file has been truncated, but you can view the full file.
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
<!DOCTYPE html> | |
<html> | |
<head><meta charset="utf-8" /> | |
<title>covid_effect_pollution_milan</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
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
MULTIPLES_DICT = { | |
3: 'Fizz', | |
5: 'Buzz', | |
7: 'Wolf', | |
} | |
def _is_by_num(num: int, multiple: int) -> bool: | |
return num % multiple == 0 |
UPDATE 2022-07: see python script attached
-
find PIDs responsibles of most memory usage:
ps aux --sort=-%mem | head
-
look at the name of the JSON used inside the jupyter launcher command, usually is
kernel-${kernel_id}.json
and get `${kernel_id} -
go at the jupyter server endpoint
/api/sessions
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 typing import Optional, List, Union | |
from typing_extensions import Literal | |
import uvicorn | |
from pydantic import BaseModel, Field | |
from fastapi import FastAPI, Body | |
class Payload(BaseModel): | |
start: int |