Python Forum
How to only extract upper or lower triangular matrix into tabular form
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to only extract upper or lower triangular matrix into tabular form
#4
x.corr().where(pd.np.triu(pd.np.ones(x.shape), k=1).astype(bool)).stack().reset_index()
You can change k to 0 to include the main diagonal of the correlation matrix.
Reply


Messages In This Thread
RE: How to only extract upper or lower triangular matrix into tabular form - by scidam - Jan-04-2019, 01:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Export data from PDF as tabular format zinho 5 707 Nov-11-2023, 08:23 AM
Last Post: Pedroski55
  Check if two matrix are equal and of not add the matrix to the list quest 3 831 Jul-10-2023, 02:41 AM
Last Post: deanhystad
  How to apply function lower() to the list? Toltimtixma 2 790 Feb-10-2023, 05:15 PM
Last Post: Toltimtixma
  Replace with upper(string) WJSwan 7 1,589 Feb-10-2023, 10:28 AM
Last Post: WJSwan
  Beginner Higher Lower Game wallytan 2 1,605 Sep-29-2022, 05:14 PM
Last Post: deanhystad
  AttributeError: 'list' object has no attribute 'upper' Anldra12 4 4,907 Apr-27-2022, 09:27 AM
Last Post: Anldra12
  Build a matrix by pressing buttons of an interface in Tkinter which extract data from juandiegopulla 1 1,954 Sep-13-2021, 07:28 PM
Last Post: deanhystad
  How to multiply a matrix with herself, until the zero matrix results peanutbutterandjelly 3 3,379 May-03-2021, 06:30 AM
Last Post: Gribouillis
  How can I add string.upper() noahneature 2 1,873 Oct-11-2020, 06:41 PM
Last Post: noahneature
  lower() applied at in operator Beerforfree 3 2,334 Mar-22-2020, 11:51 AM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020