Convert str(array) back to numpy array
If we print a numpy array, which actually use str()
, we will find it almost irreversible.
InĀ [5]:
l=arange(16).reshape(4,4)
print('l is printed as:\n', l)
Use print()
will fallback to str()
, so str()
is not the correct way.
repr()
.tolist()