In previous posts I have demonstrated how one can geocode data and plot markers using Geopy and Folium in Python. I have also demonstrated heatmapping workflows in R, using packages such as Leaflet. In this post I want to use […]
In a previous post I have already demonstrated how to use Nominatim in Python (using the Geopy module) to geocode a location name into longitude and latitude coordinates. In this post I want to show how one can geocode a […]
Using Folium in Python one can display maps. Folium can be installed using pip install. Folium make use of the leaflet.js library. In a previous post I already demonstrated how to e.g. plot markers and heatmaps onto maps in R, […]
In a previous post I constructed a simple agent-based simulation model, containing groups of agents that can be located on a battlefield grid. The model was coded in Python, using matplotlib for visualization. I went on to conduct a simple […]
This is a quick documentation on Python string operations. Writing string to variable (assignment) using equal (=) operator a = “test string” print(a) test string Line-breaks within a string (multi-line string) using three quotes b = “””This is first line, […]
In a previous post I demonstrated how one can query automotive data via Quandl directly from within a Python script. In this post I will document how to query platinum and palladium exchange prices from Quandl in Python. The data […]
A quick post on how to query data from Quandl in Python. Quandl can be installed with the “pip install” command in your command prompt. For this simply type “pip install quandl” in your Anaconda command prompt. Quandl is the […]
A quick exercise in implementing an algorithm calculates the coefficients of the first derivative of a continuous function with one variable. Implementation is done in the code below. The function takes a list of coefficients. These must be specified in […]
As a small coding exercise I will write some lines of Python code that find the maximum value in a list and return it. In Python, this can be done with a build-in default function called max(). I avoid using […]
As a small coding exercise I will write some lines of Python code that find the minimum value in a list and return it. In Python, this can be done with a build-in default function named min(). I avoid using […]
In a previous post I constructed a simple agent-based simulation model, containing groups of agents that can be located on a battlefield grid. The model was coded in Python, using matplotlib for visualization. The agents were modelled as a class, […]
A brief documentation on iterables and iterators in Python. An iterator is an object that can be iterated, i.e. one can traverse through all of its elements. Iterables are containers that can provide an iterator object. Examples of iterables are […]
This is a brief documentation on how to use sets in Python. In Python, a set is a collection – i.e. a container which without indexing and withour order. Sets are declared with {} brackets in Python # defining a […]
A quick and dirty introduction to dictionaries in Python. Dictionaries are a special container type. Each element has a key. This allows targeted search and data retrieval. However, dictionaries also have disadvantages vs. e.g. lists. E.g. a list is used […]
A quick introduction to working with lists in Python. Lists are a general container in Python. Lists are a sequence-type of data structure that can be growns and reduced in size dynamically, i.e. as needed during your program. Lists are […]
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok