A bit off Nim topic, but in general for efficient pandas operations, you should never use for loops, and use provided pandas methods or the "apply / applymap" functions if you want to apply functions element-wise. "Groupby + transform" (aka Split-Apply-Combine) is really powerful as well for getting statistics (mean, median std dev, ...) or custom functions on a subset of your data.
Are you sure you are exporting to DOCX and not XLSX? I had a good experience with xlsxwriter for that. If that still isn't enough maybe take a look at [Numexpr](https://github.com/pydata/numexpr) and lastly [Dask](http://dask.pydata.org/en/latest/). Their dataframes have the same interface as pandas, can be converted to and from but all operations create a computational graph which will be optimized and executed in parallel when you call compute. There are a few more data processing speed/memory tricks on my blog [here](https://andre-ratsimbazafy.com/data-science-bowl-2017-space-time-tricks/).
