# MethodError: Cannot \`convert\` an object of type String7 to an object of type Float32

**URL:** <https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-string7-to-an-object-of-type-float32/81163>\
**Category:** Data\
**Tags:** csv\
**Created:** [May 16, 2022, 6:35pm UTC](https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-string7-to-an-object-of-type-float32/81163 "2022-05-16T18:35:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hupdup](https://avatars.discourse-cdn.com/v4/letter/h/7ba0ec/32.png) [@Hupdup](https://discourse.julialang.org/u/Hupdup)\
**Post date:** [May 16, 2022, 6:35pm UTC](https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-string7-to-an-object-of-type-float32/81163/1 "2022-05-16T18:35:47Z")

</div>

Hi,  
I am writing a custom environment for a Reinforcement learning project. At every Timestep some Data is used to determine a part of the state/next state. I want to put this data in with a CSV file, but when I want to determine the next state via the step function I always get this Error:  
MethodError: Cannot `convert` an object of type String7 to an object of type Float32

![Problem in df](https://global.discourse-cdn.com/julialang/original/3X/e/4/e4412b76d0f674086dcf1ef6f961dd07ec520009.jpeg)

the weird thing is, that elektkwh went through, but only the second entry is causing an error, even if the value should be a zero…do you have any idea what I did wrong?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![djholiver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djholiver/32/50470_2.png) [@djholiver](https://discourse.julialang.org/u/djholiver)\
**Post date:** [May 16, 2022, 6:46pm UTC](https://discourse.julialang.org/t/methoderror-cannot-convert-an-object-of-type-string7-to-an-object-of-type-float32/81163/2 "2022-05-16T18:46:22Z")

</div>

Hi,

if you check the original source CSV you may find that the “heatingkwh” column is an empty string, and the `env.state.d_fh` is of type Float32 in the `env.state` struct that you are writing too.

Regards,
