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
"""UTC time conversion functions. | |
""" | |
from calendar import timegm | |
from datetime import datetime | |
def utcdt2epoch(utcdatetime): | |
"""Convert a datetime object expressed in UTC to a Unix timestamp expressed | |
in seconds since the epoch (Jan 1st 1970). | |
""" |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
File: stratified.py | |
Author: SpaceLis | |
Email: Wen.Li@tudelft.nl | |
Github: http://github.com/spacelis | |
Description: | |
Sampling in a stratified way. That is sampling from each subpopulation to | |
make the sample set more representative than simple random sampling. For |