I'm looking for a way to concat numbers stored in a variable and using it as variable names in Python (or interpolated as a string). Something like this:
for NUMBER in range(2000, 2020, 1):
df_NUMBER = pd.read_csv('data_NUMBER.csv')
df_NUMBER['year'] = NUMBER
is it possible?
In stata it would be like:
forvalues NUMBER = 2000(1)2019 {
import delimited using data_`NUMBER'.csv
generate year = `NUMBER'
}