Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 0. mean in Python?

Tags:

python

I am a beginner python user. Can someone explain what does this code means?

harvest["year"] = harvest.index.year
harvest["DM"] = harvest["N"] = 0.

harvest, year, DM and N are data and data variables. What does 0. mean here?

like image 407
MAR Avatar asked Jun 12 '26 15:06

MAR


1 Answers

>>> type(0)
<class 'int'>
>>> type(0.)
<class 'float'>

It just ensures that the result, while still being "zero", is a float instead of an int.

like image 144
kojiro Avatar answered Jun 15 '26 05:06

kojiro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!