0

I have a string that contains an n-dimensional array.

a = '[[1,2],[3,4]]'

I want the output to be:

b = [[1,2],[3,4]]

I have tried np.array(a) but it not working. Can I get a one-line solution for it? Thank you

mhhabib
  • 2,486
  • 1
  • 9
  • 20
VipinSC
  • 11
  • 4

0 Answers0