all,
I'm currently computing a series of square pandas DataFrame objects as part of a bootstrapping algorithm and although I can compute it correctly, computing it efficiently has thus far eluded me.
Currently the dataframes are computed as follows, using a function func, which varies according to the nature of the data:
frame = pandas.DataFrame(0, index=idx, columns=idx)
for row in idx:
for col in idx:
frame.loc[row, col] = func(row, col)
Unfortunately, the square matrices that are built can wind up being quite large (up to 10k cells), so the above can run quite slowly. Is there any way to perform this construction more efficiently than this nested loop method using pandas and/or numpy?