Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F74218751
matrice.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jul 26, 13:09
Size
847 B
Mime Type
text/x-python
Expires
Sun, Jul 28, 13:09 (2 d)
Engine
blob
Format
Raw Data
Handle
19361693
Attached To
rJNAL Jupyter notebooks for Linear Algebra
matrice.py
View Options
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 13 11:01:03 2019
@author: jecker
"""
import
numpy
as
np
def
printA
(
A
)
:
texApre
=
'$
\\
left(
\\
begin{array}{'
texA
=
''
for
i
in
np
.
asarray
(
A
)
:
texALigne
=
''
texALigne
=
texALigne
+
str
(
i
[
0
])
if
texA
==
''
:
texApre
=
texApre
+
'c'
for
j
in
i
[
1
:]
:
if
texA
==
''
:
texApre
=
texApre
+
'c'
texALigne
=
texALigne
+
' & '
+
str
(
j
)
texALigne
=
texALigne
+
'
\\\\
'
texA
=
texA
+
texALigne
texA
=
texApre
+
'} '
+
texA
[:
-
2
]
+
'
\\
end{array}
\\
right)$'
# print(texA)
display
(
Latex
(
texA
))
# done printing
A_array
=
np
.
array
([[
1
,
2
,
3
],
[
3
,
4
,
5
]])
A
=
np
.
asmatrix
(
A_array
)
del
A_array
#printA(A+A)
#printA(np.matmul(np.transpose(A),A))
printA
(
A
)
Event Timeline
Log In to Comment