Skip to content

Instantly share code, notes, and snippets.

View ragnarheidar's full-sized avatar

Ragnar Thrastarson ragnarheidar

View GitHub Profile
@ragnarheidar
ragnarheidar / PlotWeatherStations.py
Last active October 1, 2017 08:36
Leaflet map created with folium and GeoJSON
"""
And example of a python code that uses the folium library to create a lightweight
leaflet web map. The example uses a GeoJSON file that is added to the map.
Folium documentation:
http://python-visualization.github.io/folium/docs-master/
How to add popups and cluster markers:
https://ocefpaf.github.io/python4oceanographers/blog/2015/12/14/geopandas_folium/
Leaflet maps from leaflet-providers:
https://leaflet-extras.github.io/leaflet-providers/preview/
@ragnarheidar
ragnarheidar / ChangeCSVdelimiter.py
Last active July 8, 2021 17:59
A python script that reads a CSV file and writes it out with a different delimiter.
# -*- coding: utf-8 -*-
import csv
from tempfile import NamedTemporaryFile
import shutil
readfile = "SOME\\PATH\\input.csv"
writefile = "SOME\\PATH\\output.csv"
tempfile = NamedTemporaryFile(delete=False)
with open(readfile, 'rb') as csvfilein, tempfile: