Skip to content

Instantly share code, notes, and snippets.

@kaiwei
kaiwei / scb_bank_stmt_cleaner.py
Created June 12, 2020 12:14
Standard Chartered Bank Singapore Bank CSV download cleaner
import pandas as pd
import numpy as np
import sys
# Create a Dataframe from CSV
df = pd.read_csv(sys.argv[1], thousands = ',', delimiter = ',', skiprows = 5, low_memory = False, keep_default_na = False)
# Cleaning: (1) Tabs in columns and headers (2) Make numbers into numbers instead of strings
df.columns = df.columns.str.strip()
df.Date = df.Date.str.strip()
@kaiwei
kaiwei / scb_cc_stmt_cleaner.py
Created June 12, 2020 12:14
Standard Chartered Bank Singapore Credit Card CSV download cleaner
import pandas as pd
import numpy as np
import sys
# Create a Dataframe from CSV
df = pd.read_csv(sys.argv[1], thousands = ',', delimiter = ',', skiprows = 4, low_memory = False, keep_default_na = False)
# Cleaning: (1) Drop "Unposted" (2) Remove nonsense entries at the bottom (3) Remove "SG" from all Desc
df.Date = df.Date.str.strip()
df = df[~df.DESCRIPTION.str.contains("UNPOSTED")]

Keybase proof

I hereby claim:

  • I am kaiwei on github.
  • I am kaiwei (https://keybase.io/kaiwei) on keybase.
  • I have a public key ASBs0Eq64ftoeLcc765A_EgHW9ybVPuBuiFHMuetwXFjtgo

To claim this, I am signing this object:

@kaiwei
kaiwei / blogpost.py
Created July 1, 2016 07:55 — forked from josiahwiebe/blogpost.py
Post from Editorial to Jekyll on GitHub Pages
#coding: utf-8
import keychain
import console
import editor
import time
import re
import requests
import json