How to add lines from one matrix into another?

Asked

Viewed 73 times

-2

I have two matrices new_output and new_output_test and would like the matrix data new_output_test were added to the matrix new_output as the last data of this matrix.

new_output
Out[65]: 
matrix([[133.70471724],
        [131.36470398],
        [153.09454585],
        [144.66627797],
        [145.58034752],
        [147.40336716],
        [176.46292634],
        [169.96873917],
        [166.43647706],
        [136.99340888],
        [127.67090877],
        [128.35946349],
        [145.63361115],
        [147.19312269],
        [165.30157841],
        [162.30292727],
        [153.5385184 ],
        [181.76884977],
        [191.80469384],
        [203.42453663],
        [180.75203491],
        [162.66179288],
        [134.87293969],
        [166.3082651 ],
        [162.88658211],
        [183.54234967],
        [193.8605073 ],
        [191.6657475 ],
        [191.96187493],
        [202.16533112],
        [234.86332869],
        [225.18983586],
        [223.98932358],
        [177.92378288],
        [181.34266222],
        [177.42987655],
        [207.84294394],
        [194.35650338],
        [221.84632534],
        [209.03565518],
        [229.92282591],
        [238.80691828],
        [265.49847859],
        [268.15672018],
        [246.41900929],
        [213.54966299],
        [196.72084451],
        [204.81232251],
        [218.95545357],
        [216.65961873],
        [246.45092705],
        [255.1801581 ],
        [250.6714441 ],
        [267.95662049],
        [295.01133818],
        [310.09877282],
        [263.92860637],
        [242.19579775],
        [197.67049737],
        [229.15639731],
        [221.93009996],
        [232.02304812],
        [251.01562245],
        [263.09092941],
        [266.85209908],
        [298.64485202],
        [340.47566467],
        [341.90768994],
        [298.0073132 ],
        [266.75785181],
        [231.34956674],
        [254.73691568],
        [273.97251243],
        [268.43063626],
        [293.239327  ],
        [305.09307003],
        [308.82932225],
        [352.77456146],
        [407.4521825 ],
        [390.79312609],
        [360.70074714],
        [301.37716806],
        [271.49567476],
        [296.50065681],
        [314.5920208 ],
        [308.48480703],
        [337.56603603],
        [349.42228022],
        [356.42721005],
        [409.15647358],
        [457.73331607],
        [454.20279727],
        [405.80989143],
        [341.51901196],
        [304.07032166],
        [327.43784134],
        [344.24337926],
        [332.00339983],
        [372.13447776],
        [369.85825952],
        [387.59568142],
        [446.0810122 ],
        [504.67880603],
        [509.20907709],
        [453.73892055],
        [363.9567989 ],
        [338.71001209],
        [344.02195022],
        [368.66663978],
        [345.29252997],
        [388.03433932],
        [381.46563787],
        [414.93197257],
        [471.8870632 ],
        [537.62359854]])

new_output_test
Out[66]: 
matrix([[556.41638901],
        [461.00130487],
        [402.77506263],
        [338.43711049],
        [376.35405558],
        [393.57088967],
        [391.43481255],
        [425.19046746],
        [421.91087774],
        [482.32939989],
        [507.02582217],
        [613.52878223],
        [604.40085918],
        [528.93577465],
        [435.77241244],
        [413.39045755],
        [413.38428411],
        [458.30497561]])

1 answer

0


The numpy module has a method for concatenating matrices.

np.concatenate((new_output, new_output_test), axis=0)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.