Skip to content

Instantly share code, notes, and snippets.

got it!
@graphomania
graphomania / matrix_to_tex.py
Created March 30, 2021 07:23
Python Matrix to Tex String
def matrix_to_tex(matrix) -> str:
tex_str = '\\begin{matrix}\n'
lines_strs = list()
for line in matrix:
lines_strs.append(' & '.join([str(el) for el in line]))
tex_str += '\\\\\n'.join(lines_strs) + '\n\\end{matrix}'
return tex_str
@graphomania
graphomania / weather_status_to_emoji.py
Created November 9, 2020 10:53
pyowm weather status to unicode emoji function
def weather_status_to_emoji(status: str) -> str:
if status == "Clouds":
return u'\U00002601'
if status == "Clear":
return u'\U00002600'
if status == "Rain":
return u'\U00002614'
if status == "Extreme":
return u'\U0001F300'
if status == "Snow":