This file contains hidden or 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
conda create -n w2w python=3.8 --yes | |
conda activate w2w | |
conda install -c conda-forge pytorch xarray=0.16 pytorch torchvision cudatoolkit --yes | |
conda install dask --yes | |
conda install -c conda-forge rasterio scikit-image --yes | |
conda install -c conda-forge seaborn=0.11 --yes | |
conda install -c anaconda networkx --yes | |
conda install -c conda-forge zarr gcsfs netcdf4 numba tqdm jupyterlab tensorboard ipython pip ruamel.yaml descartes statsmodels scikit-learn black mypy --yes | |
conda install -c conda-forge geopandas --yes | |
conda install -c conda-forge cdsapi --yes |
This file contains hidden or 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
""" | |
Mask xarray dataset using a shapefile [closed] | |
https://stackoverflow.com/a/64587946/9940782 | |
""" | |
from typing import Tuple | |
import geopandas as gpd | |
import xarray as xr | |
import rasterio as rio | |
from pathlib import Path | |
import numpy as np |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 tika import parser | |
import os | |
def extract_text_from_pdfs_recursively(dir): | |
for root, dirs, files in os.walk(dir): | |
for file in files: | |
path_to_pdf = os.path.join(root, file) | |
[stem, ext] = os.path.splitext(path_to_pdf) | |
if ext == '.pdf': |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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(rvest) | |
library(tidyverse) | |
library(tidygraph) | |
library(ggraph) | |
wc_squads <- html("https://en.wikipedia.org/wiki/2018_FIFA_World_Cup_squads") | |
tables <- wc_squads %>% | |
html_table() |
This file contains hidden or 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
/* | |
Fit a GEV distribution in stan | |
Code is largely based on previous code by | |
Cameron Bracken: http://bechtel.colorado.edu/~bracken/tutorials/stan/ | |
and Yenan Wu: http://discourse.mc-stan.org/t/troubles-in-rejecting-initial-value/1827 | |
*/ | |
functions{ | |
real gev_lpdf(vector y, real mu, real sigma, real xi) { | |
vector[rows(y)] z; | |
vector[rows(y)] lp; |
This file contains hidden or 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
""" | |
Automatically replies to mails both unread and unanswered. | |
WARNING: This answers to any both unread and unanswered mail, even if it is years old. | |
Don’t use on a mailbox with old messages left unread and unanswered. | |
Simply subclass ``AutoReplyer``, define the undefined class attribute, | |
and call the ``run`` method on an instance. This loops until you stop the script | |
(using Ctrl+C, typically) or until an error occurs, like a network failure. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder