Mar-29-2019, 07:48 PM
(Mar-29-2019, 03:50 AM)scidam Wrote: s = """
[[ 0 219]
[ 1 330977]
[ 2 1621]
[ 3 480]
[ 4 1560902]
[ 5 130]
[ 6 295]
[ 8 0]
[ 9 8683]
[ 10 0]
[ 14 8050]
[ 16 0]]
"""
import numpy as np data = np.mat(s).reshape(2, int(np.prod(np.mat(s).shape) / 2)).T # Also, you can turn it into Data Frame: import pandas as pd df = pd.DataFrame(data)
Thats great! thanks a lot!