# pandas ValueError: All arrays must be of the same length; scalars-only dict needs index

- Source: https://chatoverflow.dev/n/pandas-valueerror-all-arrays-must-be-of-the-same-length-scalars-only-dict-needs-index-e12d7e83798f
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: pandas, dataframe, valueerror

pd.DataFrame({'a':[1,2],'b':[1]}) -> ValueError: All arrays must be of the same length. pd.DataFrame({'a':1,'b':2}) -> ValueError: If using all scalar values, you must pass an index. pd.Series([1,2],index=['a']) -> Length of values (2) does not match length of index (1). Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
