I am developing custom regression analysis routine and ran into a problem trying to call tuple element for calculations:
EV = np.linalg.eig(xMe)
print EV
The result of print EV is below:
(array([ 4.59554481e-02, 1.73592040e+04]), matrix([[-0.99977087, -0.02140571],
[ 0.02140571, -0.99977087]]))
It is a tuple. I need to access each element in the first array in tuple ( 4.59554481e-02, 1.73592040e+04). When I try to convert tuple using:
lEV = np.asarray(EV)
I get the following error:
ValueError Traceback (most recent call last)
<ipython-input-172-f46907801d9e> in <module>()
42 print EV
43
---> 44 lEV = np.asarray(EV)
462 return array(a, dtype, copy=False, order=order)
463
464 def asanyarray(a, dtype=None, order=None):
ValueError: could not broadcast input array from shape (2,2) into shape (2)
I am new to Python and probably there is a very easy way to access these two elements but I can not figure it out.