# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import numpy as np
from numpyarray_to_latex.jupyter import to_jup
from numpyarray_to_latex import to_ltx

A = np.arange(100).reshape(10,10).astype(float)
B = (np.arange(9)-4).reshape(3,3).astype(float)
C = (np.arange(9)-2).reshape(3,3).astype(float)
D = np.arange(4).astype(float)
E = B.copy()
E[1,1] = 1e27
E[1,2] = 1e-27
F = B + 1j * E * 10**C
G = B + 1j * C

to_jup(A,
       mark_elements=[(1,1),(2,3),(7,0)],
       separate_columns=[1,2],
       separate_rows=[1,2],
      )
print(to_ltx(A,
       mark_elements=[(1,1),(2,3),(7,0)],
       separate_columns=[1,2],
       separate_rows=[1,2],
      ))

to_jup(D,
       mark_elements=[1,],
       separate_columns=[1,2],
       separate_rows=[1,2],
      )

to_jup(D,
       is_row_vector=False,
       mark_elements=[1,],
       separate_columns=[1,2],
       separate_rows=[1,2],
       mark_color='yellow',
       brackets='(]',
      )

to_jup(D,
       latexarraytype='Vmatrix',
       is_row_vector=False,
       separate_rows=[1,2],
      )

to_jup(G,
       mark_elements=[(0,1)],
      )

to_jup(F,
       mark_elements=[(0,1)],
       fmt='{:4.2e}',
      )

print(to_ltx(B,
       latexarraytype='array',
       is_row_vector=False,
       mark_color='yellow',
       mark_elements=[(1,1)], 
       brackets='(]',
       separate_columns=[1,2],
       separate_rows=[1,2],))





StarcoderdataJupyterScriptsDedupFiltered