This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
id2char = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" | |
char2id = {id2char[id]: id for id in range(len(id2char))} | |
n_vocab = len(id2char) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MAYAVI SETUP | |
# mayavi is a python library for scientific visualisations, that can handle | |
# visualisation of Lidar Data. But, it can also be used to project Lidar data | |
# to 2D images. | |
# | |
# The set of commands I used to get mayavi set up on my computer so far. | |
# NOTE: I still do not know if it is set up properly, so this set of steps | |
# might be incomplete. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
VISUALISE THE LIDAR DATA FROM THE KITTI DATASET | |
Based on the sample code from | |
https://github.com/utiasSTARS/pykitti/blob/master/demos/demo_raw.py | |
And: | |
http://stackoverflow.com/a/37863912 | |
Contains two methods of visualizing lidar data interactively. | |
- Matplotlib - very slow, and likely to crash, so only 1 out of every 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#=============================================================================== | |
# TOY DATA | |
#=============================================================================== | |
# Setting up a toy dataframe | |
df = data.frame(total_crime_2015_2016=674, | |
total_crime_2014_2015=323, | |
total_crime_2013_2014=212, | |
car_theft_2015_2016=34, | |
car_theft_2014_2015=45, | |
car_theft_2013_2014=74 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO: add an option that makes use of lubridate's quarter(date) if no value is | |
# entered for the *since* argument. | |
#=============================================================================== | |
# WEEK_SINCE | |
#=============================================================================== | |
#' @title week_since | |
#' @description calculates what week number some input date is, counting from | |
#' some specified starting date (eg the Start of Financial Year) | |
#' @details You can specify any start date you want by using the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" ============================================================================= | |
This python script is for generating sentences that resemble the style of some | |
particular author. Does so by making use of Markov chains. | |
============================================================================= """ | |
from collections import Counter | |
from random import choice | |
import re | |