I hereby claim:
- I am pganssle on github.
- I am pganssle (https://keybase.io/pganssle) on keybase.
- I have a public key whose fingerprint is 6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB
To claim this, I am signing this object:
from __future__ import division | |
import struct | |
import bz2 | |
# Generate data - round to nearest 1e11 so that no data is lost when formatting in ASCII | |
xx = range(10**7) | |
x = [round(ii*1e11)/(1e11*len(xx)) for ii in xx] | |
sx = struct.pack('d'*len(x), *x) | |
# Write it to file as a text and binary file |
from datetime import datetime, timedelta | |
try: | |
from itertools import islice, filterfalse | |
except ImportError: | |
# Python 2.x | |
from itertools import islice, ifilterfalse as filterfalse | |
def _daily(start_date=datetime.now(), interval=1): |
I hereby claim:
To claim this, I am signing this object:
import pandas as pd | |
import sys | |
pdf = pd.DataFrame(dict(name= ('Earl', 'Eve', 'Alan', 'Randall', 'Danielle'), | |
age= ( 29, 17, 73, 31, 62), | |
gender= ( 'M', 'F', 'M', 'M', 'F'), | |
nationality=( 'US', 'UK', 'CAN', 'CAN', 'US'), | |
height= ( 182.9, 167.6, 175.3, 170.2, 172.8)), | |
columns=('name', 'age', 'gender', 'nationality', 'height')) | |
pdf = pdf.set_index('name') |
Most of us have faced a point when trying to make things work with the Python datetime module by just trying things around. Datetime is one of those APIs that seems easy to use but requires the developer to have a deep understanding of what things actually mean, as otherwise it is really easy to introduce unexpected bugs given the actual complexity of date and time related issues.
The first concept we need to grasp when working with time is a standard that defines how we can measure units of time. The same way we have standards to measure weight or length that define kilograms or meters, we need a way to accurately define what
import random | |
import string | |
from timeit import timeit | |
def _recombine_skipped_queue(tokens, skipped_idxs): | |
""" | |
>>> tokens = ["foo", " ", "bar", " ", "19June2000", "baz"] | |
>>> skipped_idxs = set([0, 1, 2, 5]) | |
>>> _recombine_skipped(tokens, skipped_idxs) |
import timeit | |
import operator | |
def time_func(f, N, k=3): | |
"""Basic version of IPython's %timeit magic""" | |
t = min(timeit.timeit(f, number=N) for _ in range(k)) | |
t_per = t / N | |
if t_per < 1e-6: | |
units = 'ns' |
#!/usr/bin/env bash | |
# Parse CLI arguments | |
REGEXES=() | |
POSITIONAL=() | |
while [[ $# -gt 0 ]]; do | |
key=$1 | |
case $key in | |
-r|--regex) | |
REGEXES+=("$2") |
#![feature(concat_idents,duration_as_u128)] | |
extern crate pyo3; | |
use std::thread; | |
use std::time; | |
use pyo3::prelude::*; | |
use pyo3::ffi::*; | |
use std::ffi::CString; |
These are steps for attempting to reproduce this test failure.
If you don't already have a local CPython clone, go to wherever you clone repositories and execute:
git clone [email protected]:python/cpython.git
cd cpython