Skip to content

Instantly share code, notes, and snippets.

@bethac07
Created May 5, 2021 00:21
Show Gist options
  • Save bethac07/e44c4372b81d7125e0a2d741fb5d607a to your computer and use it in GitHub Desktop.
Save bethac07/e44c4372b81d7125e0a2d741fb5d607a to your computer and use it in GitHub Desktop.
#on a fresh AWS Ubuntu 20.04 vm
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y make gcc build-essential tcl tcl-dev autoconf libtool openssl libssl-dev libbz2-dev
mkdir ~/sqlite
cd ~/sqlite
wget https://www.sqlite.org/src/tarball/sqlite.tar.gz
tar xzf sqlite.tar.gz
mkdir bld
cd bld
../sqlite/configure
#nano the makefile to add OPTS = -DSQLITE_MAX_COLUMN=32767 above the line TCC += $(OPTS) on the second page
make
make sqlite3.c
sudo make install
cd ~
wget https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tgz
tar xvf Python-3.8.10.tgz
cd Python-3.8.10/
./configure
make
make test
sudo make install
python3 -m pip install pandas
python3
#===========
import pandas
import sqlite3
df = pandas.DataFrame()
df['A'] = range(3000)
df['B'] = range(1,3001)
T = df.T
df.shape
T.shape
con = sqlite3.connect('tmp.db')
df.to_sql('tall',con)
T.to_sql('wide',con)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment