I have a folder with subfolders for each state, as follows:
Inside the subfolders there are multiple excel files of the same census, as follows:
As you can see, each file is called with the name of the module and the code of the state.
What I want to do is reading all files of the same module and concatenate them. I tried to replace the folder path with formats and dictionaries, but it's not working.
states = {'05ALABAMA','12CALIFORNIA', '15TEXAS', '20ARKANSAS','23NEWYORK'}
id_states = {'05', '12', '15', '20', '23'}
for i in states, id_states:
data = pd.read_excel(r'census{}CEN_S4_{}.csv'.format(states, id_states))
Any ideas? Thanks!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…