ValueError: dictionary update sequence element #0 has length 1; 2 is required

前端 未结 2 687
北恋
北恋 2021-01-19 02:52

I am returning 5 for my computational field old_default_code, and I am getting the following error:

ValueError: dictionary u

2条回答
  •  爱一瞬间的悲伤
    2021-01-19 03:13

    The most common way to come across this error is when you have a type casting error, for example,

    MWE to regenerate the error -

    str_var = 'abc'
    str_var = dict(str_var)
    

    Running this gives the error ValueError: dictionary update sequence element #0 has length 1; 2 is required

    Hope this helps.

提交回复
热议问题