Skip to content
Advertisement

Trying to find averages from a .txt but I keep getting ValueError: could not convert string to float: ”

I’m using the txt file: https://drive.google.com/file/d/1-VrWf7aqiqvnshVQ964zYsqaqRkcUoL1/view?usp=sharin

I’m running the script:

JavaScript

And I ALWAYS get the error: ValueError: could not convert string to float: ”

I’m pretty new-ish to Python and I’m really not sure what I’m doing wrong here. I’m trying to get averages for New York and San Francisco, then export the results AND the comparison to a txt results file

Advertisement

Answer

This should give you what you’re looking for:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement