from itertools import chain
a = (('test'),('test1'),('test2'))
b = list(chain.from_iterable(a))
输出:
['tets','test1','test2']
最后
以上就是开朗画板最近收集整理的关于python 二维数组转一维数组的全部内容,更多相关python内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
from itertools import chain
a = (('test'),('test1'),('test2'))
b = list(chain.from_iterable(a))
输出:
['tets','test1','test2']
以上就是开朗画板最近收集整理的关于python 二维数组转一维数组的全部内容,更多相关python内容请搜索靠谱客的其他文章。
发表评论 取消回复