If I have two variables as follows:
a = 2
b = 3
And I want to construct a DataFrame from this:
df2 = pd.DataFrame({'A':a,'B':b})
But when I try to do that, it gives an error:
ValueError: If using all scalar values, you must pass an index
To solve this I tried :
df2 = (pd.DataFrame({'a':a,'b':b})).reset_index()
But it gave me the same error. Can someone help me with this?