Question: In Python pandas package, I ran this code to find the element with the max value. Now, I want to find the indexes of this
In Python pandas package, I ran this code to find the element with the max value. Now, I want to find the indexes of this value ie the row and column it is located in and I can't quite figure out how. Can someone help?
corr_matrix.values.max()
0.5929046745193427(output)
UVE SWKS NKE DRE LRCX XOM PGR BBY MU TROW LOW SBUX VL 0.000000 0.208865 0.335321 0.279122 0.241963 0.294519 0.355054 0.306324 0.191996 0.275-498 390394 0327441 0231894 0322716 D224796 UVE 0.208865 0.000000 0.191572 0.190069 0.195484 0.157397 0.158999 0.364043 0.182354 0.129694 0.275147 0.189129 0.236523 0.197948 0.145696 0 SWKs 0.335321 0.191572 0.000000 0.293018 0.244859 0.592905 0.283501 0.263310 0.246085 0.500869 0.426163 0.298971 0.346746 0.374361 0.202636 0 NKE 0.279122 0.190069 0.293018 0.000000 0.307282 0.293431 0.237392 0.363927 0.252781 0.155904 0.408964 0.391927 0.419918 0.281440 0.168623 0 DRE 0.24 1 963 0.195484 0.244859 0.307282 0.000000 0.264934 0.342602 0.377485 0.150532 0.134998 O324336 0.32T34 O327452 Lr3100 220032 LRCX 0.294519 0.157397 0.592905 0.293431 0.264934 0.000000 0.291401 0.339641 0.201454 0.548026 0.463371 0.296319 0.315158 0.392636 0.187938 0 XOM 0.355054 0.158999 0.283501 0.237392 0.342802 0.291401 0.000000 0.341772 0.177252 0.293695 0.482106 0.290616 0.277507 0.441975 0.257775 0 PGR 0.306324 0.364043 0.263310 0.363927 0.377465 0.339641 0.341772 0.000000 0.196798 0.244741 0.484348 0.376077 0.353989 0.333592 0.201442 0 BBY 0.191996 0.182354 0.246085 0.252781 0.150532 0.201454 0.177252 0.196798 0.000000 0.168299 0.295559 0.341954 0.241628 0.219201 0.129415 0 MU 0.275498 0.129694 0.500869 0.155904 0.184998 0.548026 0.293695 0.244741 0.168299 0.000000 0.324632 0.232892 0.233755 0.332295 0.172721 0 TROW 0.390394 0.2751470.426163 0.408964 0.324336 0.463371 0.482106 0.484348 0.295559 0.324632 0.000000 0.443515 0.364522 0.514469 0.335365 0 LOW 0.327441 0.189129 0.298971 0.391927 0.327734 0.296319 0.290616 0.376077 0.341954 0.232892 0.443515 0.000000 0.371308 0.304890 0.251543 0 SBUX 0.291994 0.236523 0.346746 0.419918 0.327452 0.315158 0.277507 0.353989 0.241628 0.233755 0.364522 0.371308 0.000000 0.255296 0.219066 0 CE 0.322716 0.197948 0.374361 0.281440 0.273180 0.392636 0.441975 0.333592 0.219201 0.332295 0.514469 0.304890 0.255296 0.000000 0.238017 0 MCK 0.224796 0.145696 0.202636 0.168623 0.207032 0.187938 0.257775 0.201442 0.129415 0.172721 0.335365 0.251543 0.219066 0.238017 0.000000 0 PK 0.181335 0.192405 0.151306 0.229352 0.291989 0.187974 0.248849 0.189086 0.196054 0.160385 0.260846 0.283415 0.159115 0.243444 0.115814 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts

