I have an existing set of data frames that I have imported earlier as show below
import pandas as pd
class command_dictionary(object):
def __init__(self, file_location ='command_dictionary.xlsx'):
xls = pd.ExcelFile(file_location)
self.enum_beacon_mode = xls.parse('enum_beacon_mode', index_col=0, parse_cols=1, na_values=['NA'], has_index_name=True)
self.enum_boot_source = xls.parse('enum_boot_source', index_col=0, parse_cols=1, na_values=['NA'], has_index_name=True)
Later in the code i want to call one of the initialized data frames.
def validate_command(df_name):
print df_name #do stuff
print enum_beacon_mode
How do I take the df_name
string argument and use it to call an existing data frame.
Thank you in advance for everyone's help.