Python Forum
4D array with only elements on one side of the diagonal
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
4D array with only elements on one side of the diagonal
#1
Given the parameters n and m, I'd like to initialize a n x n4D array where each entry is an m x m matrix, and where each column of the matrix is an array of type numpy.linspace(0,1,m). Furthermore, I'd only like to have entries on the diagonal and above it, or only on the diagonal and below it. Is there a possible one-liner for this?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to remove some elements from an array in python? gohanhango 9 985 Nov-28-2023, 08:35 AM
Last Post: Gribouillis
  How to horizontally align and display images side-by-side in an email using Python? shantanu97 0 970 Feb-22-2023, 11:41 PM
Last Post: shantanu97
  ValueError: Length mismatch: Expected axis has 8 elements, new values have 1 elements ilknurg 1 5,013 May-17-2022, 11:38 AM
Last Post: Larz60+
  Replace elements of array with elements from another array based on a third array Cola_Reb 6 1,744 May-13-2022, 06:06 PM
Last Post: deanhystad
Question Change elements of array based on position of input data Cola_Reb 6 2,063 May-13-2022, 12:57 PM
Last Post: Cola_Reb
  Get the Client-Side TLS ? JohnnyCoffee 1 1,330 Nov-30-2021, 10:49 PM
Last Post: Larz60+
  Ho can I make it so the dirt goes up instad of diagonal izmamonke 3 2,137 Jul-12-2021, 12:51 PM
Last Post: izmamonke
  Sorting Elements via parameters pointing to those elements. rpalmer 3 2,550 Feb-10-2021, 04:53 PM
Last Post: rpalmer
  diagonal matix kraljorah 1 1,841 Dec-20-2020, 05:11 AM
Last Post: ndc85430
  Removing some elements from array based on a condition claw91 0 1,483 Oct-27-2020, 03:42 PM
Last Post: claw91

Forum Jump:

User Panel Messages

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