特牛网址导航

python 变量类型判断_[]是数组还是列表python-CSDN博客

网友收藏
文章浏览阅读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