R
R
redduckrobot2016-05-11 17:01:03
Python
redduckrobot, 2016-05-11 17:01:03

What and how to load a set of matrices?

Hello, at the university they gave a task on numerical methods and there were difficulties in loading data from a file (an example of matrices is below, matrices A and B are interconnected). I tried in csv - everything is fine with one matrix, but I still don’t understand how to load 2-3 ... matrices (if this is possible in this task). Tell me, please, what is the best format to use and how to format and read it all. Thank you.
650dcc0018154dafb46ca0751ff87fed.jpg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2016-05-11
@redduckrobot

json IMHO is the best option:

{
"a": [
[0,1,2],
[3,4,5],
[6,7,8]
],
"b":[
[0,1,2,3],
[4,5,6,7],
[8,9,0,1]
]
}

T
tsarevfs, 2016-05-11
@tsarevfs

Option 1 - separate files for matrices.
Option 2:
2 // number of matrices
2 2 // rows, columns in 1 matrix
1 2
3 4
3 4
3 3 // rows, columns in 1 matrix
1 2 3
4 5 6
7 8 9
3 option -- json

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question