I ran numerous experiments and different methods. Some threw warnings. Some did not. The simplest seemed to be to create a dt from the df and then use the dt to transfer data. That never threw an error.
However, as to the speed problem... the ONLY thing that made a difference was whether I was trying to write values to a column that had been newly created, or if I was trying to write values to a column that existed when the datatable was opened (or created). Newly created columns updated extremely slow. Preexisting columns updated plenty fast.
Results of last text on 100k rows. 4 parameters already existed and 5 new columns added before I ran this code. 9 total columns updated.
#These 'xfers' all used dt['colname'] = dt_results['colname'] syntax. No DataFrames involved after DF was used to create dt_results.
Step df_results creation time: 0.3434 seconds
Step Param 1 xfer time: 0.1795 seconds
Step Param 2 xfer time: 0.1758 seconds
Step df_results creation time: 0.0231 seconds #This is a new set of result of different df function return.
Step Param 3 xfer time: 0.1838 seconds
Step Param 4 xfer time: 0.1890 seconds
#Code here was: dt['NewCol1Test'] = df_results[stringnameofcolumn]
FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
df to dt with names xfer time: 15.8251 seconds
#Code here was: dt['NewCol2Test'] = df_results.iloc[:,dfColumnIndex]
FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
#I don't know why that warning was still thrown when I used iloc
df to dt with iloc xfer time: 16.0874 seconds
#Code here was: dt['NewCol3Test'] = dt_results[dfColumnIndex]
dt index to dt name xfer time: 14.5659 seconds
#Code here was: dt[NewColumnIndex] = dt_results[dfColumnIndex]
dt index to dt index xfer time: 14.4699 seconds
#Code here was:
jmp.run_jsl('dt << Begin Data Update;')
dt['NewCol5Test'] = dt_results[dfColumnIndex]
jmp.run_jsl('dt << End Data Update;')
#Warning/Error Result:
"Name Unresolved: dt in access or evaluation of 'dt' , dt/*###*/
at line 1
Name Unresolved: dt in access or evaluation of 'dt' , dt/*###*/
at line 1"
#This print was actually on the same line as the second 'at line 1' error message.
dt to dt w indices wrapped in begin/end update xfer time: 14.3627 seconds
#Final summary of run time on 100k rows.
Total Execution time: 77.0904 seconds