Created
December 30, 2018 03:46
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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