python - 0. 在 Python 中是什么意思?
问题描述
我是初学者 python 用户。有人可以解释这段代码是什么意思吗?
harvest["year"] = harvest.index.year
harvest["DM"] = harvest["N"] = 0.
harvest
, year
,DM
和N
是数据和数据变量。这里是什么0.
意思?
解决方案
>>> type(0)
<class 'int'>
>>> type(0.)
<class 'float'>
它只是确保结果虽然仍然是“零”,但它是float 而不是 int。
推荐阅读
- java - 如何使用 Mockito 模拟 Api 包装器上的一系列调用
- kotlin - 如何使用 Cloud Firestore 将其他集合数据添加到文档中?
- scala - 在包 Intellij IDEA 中找不到套件类
- java - for循环初始化语句Java中的变量范围
- javascript - 如何使用 selenium webdriver 处理角度覆盖并从下拉列表中选择多个值(来自 excel)
- sql - 我在 PostgreSQL 中遇到语法错误问题。我正在尝试添加一个查询,但它给了我一个错误
- react-native - react-native-image-slider-box 未按预期工作
- javascript - React - 组件未更新
- python - 如何将HSV色彩空间的V通道的值设置为恒定值
- ffmpeg - FFMPEG 将不正确的 mp4 转换为 ts