0

So I have:

    ticker_list = ['aapl','nvda','pglc']
    for ticker in ticker_list:
        ticker_price = create_dataframe( path, ticker )

Where create_dataframe( path, ticker ) is a custom function that creates a pandas data frame out of daily price data that includes various calculations such as moving average, RSI, etc.

The last line is where my issue is. I'm trying to create a series of variables with the names:

aapl_price
nvda_price
pglc_price

etc.

Each of these variables would be a pandas data frame with a bunch of columns that I can then pass to another function later on.

How do I get automatically generate these variable names? I've seen several answered questions where they're trying to associate a single value with a name, and they're answered by telling them to use a dictionary to make that association instead, but I'm not sure that's possible with a pandas data frame.

user3666197
  • 1
  • 6
  • 50
  • 92

0 Answers0