python - Reading different tables from a directory into an array of separate dataframes -


i have several csv files (tables) in directory (all tables have different schemas) , want loop on files , read each table separate dataframe.

is there way in python/pandas - read different tables dataframe array? how multiple tables (with different schema) imported multiple separate data frames?

try this;

import os import pandas pd import glob os.chdir("e:/") # change directory csv files stored csv_files = {} # store dataframes in dictionary file in glob.glob("*.csv"):      csv_files[file] = pd.read_csv(file)  dataframe in csv_files.values():     print dataframe 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -