I have a input of dictionary like this -
import pandas as p , numpy as n
dict={
's1':n.array([[1,2],[3,4]]),
's2':n.array([[5,6],[7,8]])
}
print(p.DataFrame(dict,index=[0]))
Expeced o/p
s1 s2
0 [1,2] [5,6]
1 [3,4] [7,8]
I'm getting an exception :data must be 1 dimensional , but when I pass 2d list in value I get the expected o/p. How to prevent this exception ??