'How can I do this more simple?

How can I do this more simple?

ADX14 = ta.ADX(df['High'], df['Low'], df['Close'], timeperiod = 14)
df['ADX14'] = ADX14

ADX50 = ta.ADX(df['High'], df['Low'], df['Close'], timeperiod = 50)
df['ADX50'] = ADX50

ADX100 = ta.ADX(df['High'], df['Low'], df['Close'], timeperiod = 100)
df['ADX100'] = ADX100

ADX150 = ta.ADX(df['High'], df['Low'], df['Close'], timeperiod = 150)
df['ADX150'] = ADX150

ADX200 = ta.ADX(df['High'], df['Low'], df['Close'], timeperiod = 200)
df['ADX200'] = ADX200

I want to create a column with all periods, in this case I select 14, 50, 100, 150 and 200, but I want to do something like in range of 14 to 200, create a new column. I thought that was simple with a for bucle but I couldn't do it well. I know it is a bad practice but I'm a newbye.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source