Questions tagged [diagonal]

Diagonal means either a diagonal matrix (usually a square matrix) in which the entries outside the main diagonal are all zero. The diagonal entries themselves may or may not be zero. Or, the values of the diagonal matrix.

Since a lot of things in programming is based on matrices doing thing horizontal or vertical is often easier then doing it diagonal. Questions dealing with these difficulties should be tagged diagonal.

Diagonal matrices occur in many areas of linear algebra. Because of the simple description of the matrix operation and eigenvalues/eigenvectors, it is always desirable to represent a given matrix or linear map by a diagonal matrix.

You probably want to add more specific tags about the technology you are using. Areas where the tag ´diagonal´ becomes relevant often drawing and animation.

584 questions
1
vote
0 answers

Diagonal Scroll in React Native

Does anyone have idea on how to scroll content diagonally in react-native? ... This one scrolls either horizontally or vertically, but not diagonally.
gsy
  • 327
  • 1
  • 4
  • 10
1
vote
1 answer

Set diagonal values in a Dataframe

Similar questions have been asked already but I still can't come up with a solution. I have a pandas Dataframe of such a shape: 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 -1 0 …
1
vote
1 answer

Oneliner in R to replace upper triangle of a matrix with its lower triangle?

How to copy the lower triangle of a matrix to the upper triangle of that same matrix? mat <- t(lower.tri(mat) * mat) + lower.tri(mat) * mat ...does not keep the diagonal (I know it shouldn't.). I can save the diagonal to a separate variable before…
1
vote
1 answer

How to flatten a diagonal dataframe after reading an XML file?

I have a series of a large XML files that I would like to import into a pandas DataFrame. All the XML data files have the same structure. Here is one of those files as a sample: