I found the following method for me. It basically creates namedtuplecontaining the names of all the variables in the data frame as strings.
, , 2 , "variable_1" "variable_2":
from collections import namedtuple
from pandas import DataFrame
import numpy as np
df = DataFrame({'variable_1':np.arange(5),'variable_2':np.arange(5)})
"var":
def ntuples():
list_of_names = df.columns.values
list_of_names_dict = {x:x for x in list_of_names}
Varnames = namedtuple('Varnames', list_of_names)
return Varnames(**list_of_names_dict)
var = ntuples()
, var. Tab, df. var.variable_1 'variable_1'. : df[var.variable_1].
, , , . namedtuple "var", , ntuples(), .