[Python] Value Error: arrays must all be same length

When I was scraping with Python3, I got an error of ValueError: arrays must all be same length

Cause

ValueError: arrays must all be same length seems to give this error if the length of the extracted list is different

Example

dt={'key1': [1,2,3], 'key2': [1,2,3,4], 'key3': [1,2]}

Countermeasures

Align the length of the list

Example

dt={'key1': [1,2,3], 'key2': [1,2,3], 'key3': [1,2,3]}

reference https://qiita.com/ShoheiKojima/items/30ee0925472b7b3e5d5c

Recommended Posts

[Python] Value Error: arrays must all be same length
[Road to Intermediate] Python seems to be all objects