Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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: [email protected] | |
| 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 |
This file contains hidden or 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). | |
| """ |