返回

python——如何将列表作为新列附加到Excel中?

发布时间:2022-05-29 17:57:49 348
# node.js

StructuredSecuritiesWaterfallReserveAccountStructuredSecuritiesWaterfall.

for tranche, reserve in zip(StructuredSecuritiesWaterfall, ReserveAccount):
    # since it is list of list, we need to flatten it first
    flattened_tranche = [item for sublist in tranche for item in sublist]
    fp.write(','.join(map(str, list(itertools.chain(flattened_tranche))) + 
                      [str(reserve)]) + '\n')

我试过上面的方法,但是unsupported operand type(s) for +: 'map' and 'list'.关于如何达到目的有什么想法吗?

特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(0)
按点赞数排序
用户头像