博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python将嵌套数组转为单层数组
阅读量:2012 次
发布时间:2019-04-28

本文共 190 字,大约阅读时间需要 1 分钟。

import itertools

a = [[1,2,3],[4,5,6], [7], [8,9]]
out = list(itertools.chain.from_iterable(a))
. >>> [ 1,2,3,4,5,6,7,8,9]
参考连接:https://blog.csdn.net/weixin_39541558/article/details/80060175

你可能感兴趣的文章
Android Intent Service Usage
查看>>
Ubnutu14 安装mysql
查看>>
Android AsyncTask usage
查看>>
Android Looper And Hander 机制剖析 - 01
查看>>
Android Looper And Hander 机制剖析 - 02
查看>>
Android Looper And Hander 机制剖析 - 03
查看>>
'Microsoft.Office.Interop.Excel.ApplicationClass' has no constructors defined
查看>>
SAP各模块介绍
查看>>
Quartz.NET 任务调度框架 - 01
查看>>
慎用 BMC Filter
查看>>
Windows Azure HDInsight
查看>>
Windows Azure HDInsight - 使用Hadoop 做数据分析
查看>>
Windows Server AppFabric Caching
查看>>
Apache Spark for Azure HDInsight
查看>>
Windows Azure Service Bus - Bridge of Azure And Private Cloud
查看>>
How to use the Service Bus relay service
查看>>
技术真的能改变世界嘛?
查看>>
体验 Docker
查看>>
Web.config 加密及解密
查看>>
Expression Tree Introduction
查看>>