alexgand / springer_free_books

Python script to download all Springer books released for free during the 2020 COVID-19 quarantine
GNU General Public License v3.0
1.65k stars 366 forks source link

object of type 'float' has no len() #103

Closed MDAddario closed 4 years ago

MDAddario commented 4 years ago

I tried running the simple python3 main.py after installing the dependencies but I got the following error:

[~]:python3 main.py

387 titles ready to be downloaded... Traceback (most recent call last): File "main.py", line 95, in <module> download_books(books, folder, patches) File "/mnt/c/Users/bounc/Desktop/springer_free_books/helper.py", line 126, in download_books longest_name = books[CATEGORY].map(len).max() File "/home/mlindn/.local/lib/python3.8/site-packages/pandas/core/series.py", line 3630, in map new_values = super()._map_values(arg, na_action=na_action) File "/home/mlindn/.local/lib/python3.8/site-packages/pandas/core/base.py", line 1145, in _map_values new_values = map_f(values, mapper) File "pandas/_libs/lib.pyx", line 2329, in pandas._libs.lib.map_infer TypeError: object of type 'float' has no len()

I am running this on Ubuntu 20.04 WSL

chaosAD commented 4 years ago

Springer messed up the Excel file by introducing an empty entry in the Excel file. The error you encountered was due to that. I have fixed it in my PR #104 and #105.