Skip to content

Instantly share code, notes, and snippets.

View stefanthoss's full-sized avatar
🏠
Working from home

Stefan Thoss stefanthoss

🏠
Working from home
View GitHub Profile
@stefanthoss
stefanthoss / mysql-pandas-import.py
Last active December 26, 2023 19:48
Import data from a MySQL database table into a Pandas DataFrame using the pymysql package.
import pandas as pd
import pymysql
from sqlalchemy import create_engine
engine = create_engine("mysql+pymysql://USER:PASSWORD@HOST:PORT/DBNAME")
df = pd.read_sql_query("SELECT * FROM table", engine)
df.head()
@stefanthoss
stefanthoss / pbzip2.Dockerfile
Last active March 26, 2024 11:29
Install pbzip2 in an Alpine Linux Docker image
FROM alpine:3.10
RUN apk add --no-cache \
bzip2-dev \
g++ \
make
RUN cd /tmp/ && \
wget -q https://launchpad.net/pbzip2/1.1/1.1.13/+download/pbzip2-1.1.13.tar.gz && \
tar -xzf pbzip2-1.1.13.tar.gz && \