I have multiple csv files with similar names in numeric order (nba_1, nba_2, etc). They are all formatted the same as far as column names and dtypes. Instead of manually pulling each one in individually to a dataframe (nba_1 = pd.read_csv('/nba_1.csv'))
is there a way to write a for
loop or something like it to pull them in and name them? I think the basic framework would be something like:
for i in range(1, 6):
nba_i = pd.read_csv('../nba_i.csv')
Beyond that, I do not know the particulars. Once I pull them in I will be performing the same actions on each of them (deleting and formating the same columns) so I would also want to iterate through them there.
Thank you in advance for your help.