The following code provides my necessary functions; but for a table that includes 200 variables with 64,000 rows, it takes a little over 10 seconds. Is there a more efficient way to create a variable namespace that matches column names?
strExec = "a = table[:]"
for colobj in table.description._f_walk(type="Col"):
colName = colobj._v_pathname
strExec = strExec + '\n' + colName + " = a['" + colName + "']"
exec(strExec)
The code will be executed in the analysis environment and will represent most of the waiting time for the end user; therefore, I would like to confirm that this is the best way to achieve dynamically creating a namespace based on PyTable column names.
source
share