Category Archives: Python

Calculating distance from Lat & Lon coordinates using Python & Pandas

Given a GPS log file structured as follows (column separators omitted for clarity): Speed Latitud Longitud Time 2019-01-07 06:15:27 0 59.649582 17.721365 2019-01-07 06:16:28 0 59.649583 17.721372 2019-01-07 06:17:28 0 59.649583 17.721370 2019-01-07 06:18:28 0 59.649583 17.721372 2019-01-07 06:19:29 0 … Continue reading

Posted in Data Analytics, Math, Nautical Information Systems, Pandas, Python | Tagged , , , , | Leave a comment

Geolocation with Google API’s & Python – mapping addresses to GPS coordinates

Google does some pretty impressive things – not just all the web-based search stuff, but they also have lot’s and lot’s of really cool API’s for programmers to peruse. In order to access these API’s, you need a personal authorization … Continue reading

Posted in API, Data Analytics, Python, Web | Tagged , , , | Leave a comment

Vasaloppet 2018 – race time analysis

An analysis of race times for the ~11000 men and ~2000 women that participated in 2018 Vasaloppet. For explanations of the graphs, see earlier posts on Marcialonga or Tour de Ski. [Btw, the weird looking vertical orange/blue “spike” in the … Continue reading

Posted in Data Analytics, Numpy, Pandas, Python, sports, Statistics, Web | Tagged , , , , | Leave a comment

Tour de Ski Final climb – does age matter for performance ?

In an earlier post, I analyzed data from the Marcialonga Ski race. Marcialonga is one of the classic long distance ski races, where both elite’ as well as amateurs compete together. In fact, the vast majority of the competitors in … Continue reading

Posted in Bayes, Data Analytics, Math, Numpy, Pandas, Probability, PYMC, Python, SNA, sports, Statistics | Tagged , , , , , , , , | Leave a comment

Marcialonga Ski 2018 – some Analytics

Now, with the power grid finally – after 62 hours! – back in business, I’m able to continue my stats/analytics exploration of the past Marcialonga ski race. First, some basic stats about the race: Total number of participants: 5558, of … Continue reading

Posted in Bayes, Data Analytics, Numpy, Pandas, Probability, PYMC, Python, sports, Statistics | Tagged , , , , , , , , , | Leave a comment

Ugly soup with Python, requests & Beautiful Soup

Web scraping has never been a coveted nor favorite discipline of mine; in fact, for me web scraping is an unfortunate, but sometimes necessary evil. Scraping web-pages, at least for me, is a very unstructured process, basically pure Trial & … Continue reading

Posted in Data Analytics, development, Python, Web | Tagged , , , , , | Leave a comment

Bayesian Linear Regression with PYMC

Python, Pandas & PYMC example on Bayesian Linear Regression, adopted from Richard McElreath’s “Statistical Rethinking” class, where he uses R as modeling language instead of PYMC. Data in a csv-file describe various attributes such as weight, height, age, gender etc … Continue reading

Posted in Bayes, Data Analytics, Numpy, Pandas, Probability, PYMC, Python, Statistics | Tagged , , , , , , , | Leave a comment

Python & Pandas to map gps coordinates to known locations

Assume you have a gps log file, with time and position (Lat,Lon in columns 9,10) info, like: 2018.12.12 00:41:20;0;0;0;0;0;1;0;25.8;59.348978;17.969643;0;0; 2018.12.12 01:41:21;0;0;0;0;0;1;0;25.7;59.348962;17.969627;0;0; 2018.12.12 02:41:21;0;0;0;0;0;1;0;25.7;59.349;17.969688;0;0; 2018.12.12 03:41:21;0;0;0;0;0;1;0;25.7;59.349;17.96966;0;0; 2018.12.12 04:41:22;0;0;0;0;0;1;0;25.6;59.349007;17.969618;0;0; 2018.12.12 04:48:50;0;0;0;0;1;1;1;25.2;59.349007;17.969635;0;0; 2018.12.12 04:49:51;0;0.001;0;0;1;1;1;28.3;59.349;17.969642;0;0; Assume further that you’d like to map each of … Continue reading

Posted in Maritime Technology, Nautical Information Systems, Numpy, Pandas, Python | Tagged , , , | Leave a comment

Why (sample) size matters – Bayesian Inference

[The following example is adapted from Richard McElreath’s excellent “Statistical Rethinking”] Let’s say you have bought a bag of marbles. The marbles in the bag are either blue or white. But you don’t know the proportions, that is, the ratio … Continue reading

Posted in Bayes, Probability, PYMC, Python, Statistics | Tagged , , , , | Leave a comment

Using Bayesian Inference to predict and bet on Italian Serie A Fotball

As my old timer readers know, I’be been using Bayesian Inference to predict and bet on various sporting events, such as FIFA World Cup, and IIHF World Championships. With some success. When the Italian premier division started for about a … Continue reading

Posted in Bayes, Data Analytics, Gambling, Machine Learning, Numpy, Probability, PYMC, Python, Simulation, Statistics | Tagged , , , , , , , , , , , , , | Leave a comment