ValueError: If using all scalar values, you must pass an index
This machine learning error message says pandas DataFrame needs an index. While pandas create data frame from a dictionary, it is expecting its value to be a list or dict. If you give it a scalar , you'll also need to supply index. What this is essentially asking for is a column number for each dictionary items. You can solve this issue by using the following methods:
x = 100
y = 200
df = pd.DataFrame({'X': [x], 'Y': [y]}) //adding values inside squire brackets
Or
df = pd.DataFrame({'X': x, 'Y': y}, index=[0]) //pass index value
http://net-informations.com/ds/iq/mliq.htm