热线电话:13121318867

登录
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。

7.1389
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子