How to construct pandas using dataframe from values which gives us value error
Here the error message says that for passing scalar values, you need to pass an index.
So you can either not utilize scalar values for the columns: >>> df = pd.DataFrame({'A': [a], 'B': [b]})
>>> df
A B
0 2 3
or use you can use scalar values and pass an index:
>>> df = pd.DataFrame({'A': a, 'B': b}, index=[0])
>>> df
A B
0 2 3