网站介绍:文章浏览阅读373次。这里写自定义目录标题判断一个变量是列表还是数组判断一个变量是列表还是数组import numpy as np type1 = ' 'a = [1,2,3,4,5]if isinstance(a,list): type1 = ' a is list'elif isinstance(a,np.ndarray): type1 = 'a is np.ndarray' else: type1 = 'other type!'print( 'type = ',type1 )_[]是数组还是列表python
- 链接地址:https://blog.csdn.net/travel_with_hope/article/details/117454235
- 链接标题:python 变量类型判断_[]是数组还是列表python-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:4120
- 网站标签:[]是数组还是列表python