Last active
April 24, 2016 18:55
-
-
Save dengjonathan/34e6b0e3ff7da66c1c98adf09b7af96b to your computer and use it in GitHub Desktop.
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
def csv2dataframe(fileobj): | |
"""Returns csv file as a pandas dataframe""" | |
with open(fileobj, 'r') as f: | |
return pd.read_csv(f, header=0) | |
# read all csv files to DataFrame objects and append to list then concatenate all dfs in list into one 'super_df' | |
df_list = [csv2dataframe(file) for file in os.listdir(os.getcwd()) if file.endswith('.csv')] | |
ranger_classes = [1, 3, 4, 5, 6, 7, 8, 9, 10, 11] | |
super_df = pd.concat(df_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment