ktl014
7/21/2017 - 10:46 PM

panda_error: (ValueError: If using all scalar values, you must pass an index)

panda_error: (ValueError: If using all scalar values, you must pass an index)

#The error message says that if you're passing scalar values, you have to pass an index. So #you can either not use scalar values for the columns -- e.g. use a list:

>>> df = pd.DataFrame({'A': [a], 'B': [b]})
>>> df
   A  B
0  2  3

#or use scalar values and pass an index:
>>> df = pd.DataFrame({'A': a, 'B': b}, index=[0])
>>> df
   A  B
0  2  3