. Advertisement .
..3..
. Advertisement .
..4..
Do you know why I get the error “value error if using all scalar values you must pass an index”? Your suggestions will be very helpful to me. Thanks.
The error message show that when you’re passing scalar value it is necessary to provide an index. Therefore, you cannot make use of scalar values in the columns, e.g. make use of a list. Here is one of the solution that you can apply it: An, another option that you can use scalar values or provide an index:>>> df = pd.DataFrame({'C': [c], 'D': [d]})
>>> df
C D
0 2 3
>>> df = pd.DataFrame({'C': c, 'D': d}, index=[0])
>>> df
C D
0 2 3
If you want something super simple