Skip to content

Instantly share code, notes, and snippets.

View jjsantos01's full-sized avatar
🐍

Juan Santos Ochoa jjsantos01

🐍
View GitHub Profile
@brenes
brenes / README.md
Last active July 10, 2024 13:50
CSV de paises, con nombre en castellano, ingles, codigo ISO y prefijo telefónico del país
@demisjohn
demisjohn / Pickle: Save+Load MPL Figures to file.py
Last active February 11, 2021 15:14
How to use Python's `pickle` to save/load matplotlib Figures to/from a file.
'''
To save python objects of any sort, to a file.
'''
import pickle as pkl
pkl.dump( fig, open('FigureObject.pickle', 'wb') )
pkl.dump( fig, open('FigureObject.pickle', 'wb'), fix_imports=True ) # fix_imports makes it py2x compatible - untested
'''
Load python objects from file
@ResidentMario
ResidentMario / .block
Last active February 13, 2023 21:01
Sankey webmap
license: mit
@treuille
treuille / render_svg.py
Last active May 20, 2024 21:42
Workaround: Displaying SVG images in Streamlit
import streamlit as st
import base64
import textwrap
def render_svg(svg):
"""Renders the given svg string."""
b64 = base64.b64encode(svg.encode('utf-8')).decode("utf-8")
html = r'<img src="data:image/svg+xml;base64,%s"/>' % b64
st.write(html, unsafe_allow_html=True)
@jtornero
jtornero / gist:4ae64933e99e21d27f5044b4f42e78ec
Last active March 17, 2022 19:08
Vector layer batch creation with PyQGis
# Ejemplo de cómo crear capas en QGIS y dotarlas de simbología basada en reglas
# Las fuentes en las que me he basado para crearlo son principalmente el QGIS Cookbook,
# algún artículo de Anita Grase y otras fuentes como
# https://gis.stackexchange.com/questions/86770/how-to-programmatically-set-a-rule-based-renderer-in-qgis
# Cuando pueda subir un artículo más detallado a la wiki de qgis
# se acompañará de estas fuentes en detalle con enlaces,etc, para referencia y consulta
# En mi caso creo una capa por cada una de estas especies de peces,
que meto en un diccionario junto al color que tendrá la capa
@ThomasG77
ThomasG77 / README.md
Last active April 8, 2024 20:17
Run PyQGIS in Jupyter Notebook