A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
'''This script goes along the blog post | |
"Building powerful image classification models using very little data" | |
from blog.keras.io. | |
It uses data that can be downloaded at: | |
https://www.kaggle.com/c/dogs-vs-cats/data | |
In our setup, we: | |
- created a data/ folder | |
- created train/ and validation/ subfolders inside data/ | |
- created cats/ and dogs/ subfolders inside train/ and validation/ | |
- put the cat pictures index 0-999 in data/train/cats |
Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.
This will create a job that collects required information about the vault.
$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME
import boto3 | |
import pandas | |
AWS_ACCESS_KEY_ID = 'YOUR_AWS_ACCESS_KEY_ID' | |
AWS_SECRET_ACCESS_KEY = 'YOUR_AWS_SECRET_ACCESS_KEY' | |
# connect to s3 | |
s3 = boto3.client( | |
's3', | |
aws_access_key_id=AWS_ACCESS_KEY_ID, |
# Setup Ubuntu | |
sudo apt update --yes | |
sudo apt upgrade --yes | |
# Get Miniforge and make it the main Python interpreter | |
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh -O ~/miniforge.sh | |
bash ~/miniforge.sh -b -p ~/miniforge | |
rm ~/miniforge.sh | |
echo "PATH=$PATH:$HOME/miniforge/bin" >> .bashrc |