I have a function which takes several arguments. One of the arguments refers to a data frame. Now I want to use this argument as both a data frame (which I am easily able to) and a string (which I am just not able to). By string I mean, I want to use the name of the data frame as a string.
def get_avg_spectrum(full_signal, fs, skip_samples = 0,...):
code...
...
...
return output
result = get_avg_spectrum(full_signal = acc_x_g, fs = 5000, skip_samples = 0,...)
Here, "acc_x_g" refers to a Pandas series. So I want to use the whole series as well as the text "acc_x_g".
# the below doesn't work
full_signal.name
Out[104]: 'ACC'
# ACC is the name of the variable in the Pandas Series "acc_x_g"
I have a lot of series' to run this function for so the idea is to simply keep changing the "full_signal = xxx" parameter in the function. Can anyone please help with this.