2020-03-14
阅读量:
834
python里怎么查看数据类型
python里可以通过type()函数来查看数据类型。
Python type() 函数如果你只有第一个参数则返回对象的类型。
例:这里为了能看到参数的类型,我们用print()方法把返回结果打印出来了。
print(type(1)) # <class 'int'>
print(type("1")) # <class 'str'>
print(type([1,2])) # <class 'list'>
print(type({1:2})) # <class 'dict'>

如图我们可看出df的数据类型是DataFrame。






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
3条评论