Getting stuck on a Python Truth Value Error

What happens when you get stuck and nothing seems to work?

That’s what happened with me. I kept getting a Python Truth Value error when running code in my Colab Notebook. From the 7th of August to the 18th I tried all manner of things to work out why.

Eleven days of frustration doesn’t seem like a long time but my confidence did take a hit. And I started doubting my ability to do this work. Even reaching out to my contacts on Discord and Twitter didn’t help. I guess because this error can result from all sorts of mistakes in code.

I found my favorite book “The Dip” by Seth Godin. Was I in a “Dip” or had I reached a “Cul de Sac”? I mulled over this question every morning while out walking along the coast or in the bush where I live. And came to the conclusion that it was indeed a dip. A test of my resolve. The lizard brain was saying that I should give up and that I was delusional…a fake.

Then another of my mentors I love and respect came to mind. It was Marie Forleo. I have her book too, called “Everything is Figureoutable”.

Okay. So I kept playing around looking for solutions. Then one day I stumbled on a YouTube video created by my teacher, Daniel Bourke of Zero To Mastery, titled “Six Tips for Self Learning”. I found it really helpful.

The following day I went back to the code in my Colaboratory Notebook. I was in a different state of mind and checked a “Beast Batching Function” line by line. I compared my code with Daniels as he took us through it in a ZTM ML module video on batching data.

And EUREKA I found not one error but TWO! On running the code again it worked. Thank goodness. So my friends if the same thing happens to you keep trying. I think of the muse described in Steven Pressfields books. She is just waiting for us to sit down and do the work. Only then will she deliver. So true.