Skip to content

Instantly share code, notes, and snippets.

@sweemeng
Created December 30, 2018 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sweemeng/ac45722e70cbd25133a5ee719e5aca2f to your computer and use it in GitHub Desktop.
Save sweemeng/ac45722e70cbd25133a5ee719e5aca2f to your computer and use it in GitHub Desktop.
This is a code to process various food price dataset on data.gov.my
import pandas
def processor(file_name):
df = pandas.read_excel(file_name, skiprows=1)
# drop bad column
columns = df.columns
for column in columns:
if "Unnamed" in column:
df = df.drop(column, axis=1)
df = df.dropna(thresh=2)
return df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment