I am trying to execute the following code
def get_data(full_file_path, **kwargs):
file_extension = full_file_path.split(".")[-1]
method = {"data":read_table(full_file_path, **kwargs),
"csv":read_csv(full_file_path, **kwargs)}
data = pd.method.get(file_extension)
return data
I am getting the error:
File "C:\Users\code\src\data\make_dataset.py", line 7, in get_data
method = {"data":read_table(full_file_path, **kwargs),
NameError: name 'read_table' is not defined
Does someone know if it is possible to choose a method of an object, based on a dictionary?
Thanks in advance.
ps.: yes, I have ìmported pandas as pd
.