"""
report how many days it has been since each developer committed.  You
must do an

svn log > log.txt

and place the output next to this file before running

"""
import os, datetime

import matplotlib.cbook as cbook

todate = cbook.todate("%Y-%m-%d")
today = datetime.date.today()
if not os.path.exists("log.txt"):
    print('You must place the "svn log" output into a file "log.txt"')
    raise SystemExit

parse = False

lastd = dict()
for line in file("log.txt"):
    if line.startswith("--------"):
        parse = True
        continue

    if parse:
        parts = [part.strip() for part in line.split("|")]
        developer = parts[1]
        dateparts = parts[2].split(" ")
예제 #2
0
import pandas
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import matplotlib.widgets as widgets

converters = {'Date' : cbook.todate('%Y-%m-%d') }
df = pandas.read_csv('data/CROX.csv', converters=converters)
df = df.sort('Date')
df = df[-500:] # get the two years or so
df['daily_return'] = df['Adj Close']/df['Adj Close'].shift(1) - 1

def on_rectangle_select(event_press, event_release):
    'args the press and release events'
    x1, y1 = event_press.xdata, event_press.ydata
    x2, y2 = event_release.xdata, event_release.ydata
    print "RECT: (%3.2f, %3.2f) --> (%3.2f, %3.2f)" % (x1, y1, x2, y2)

    if x1>x2:
        x1, x2 = x2, x1

    if y1>y2:
        y1, y2 = y2, y1

    x = df[xfield]
    y = df[yfield]
    # find the region of the dataframe in the selection
    mask = (x>=x1) & (x<=x2) & (y>=y1) & (y<=y2)
    print(df[mask].to_string())

예제 #3
0
"""
report how many days it has been since each developer committed.  You
must do an

svn log > log.txt

and place the output next to this file before running

"""
import os, datetime

import matplotlib.cbook as cbook

todate = cbook.todate('%Y-%m-%d')
today = datetime.date.today()
if not os.path.exists('log.txt'):
    print('You must place the "svn log" output into a file "log.txt"')
    raise SystemExit

parse = False

lastd = dict()
for line in file('log.txt'):
    if line.startswith('--------'):
        parse = True
        continue

    if parse:
        parts = [part.strip() for part in line.split('|')]
        developer = parts[1]
        dateparts = parts[2].split(' ')
예제 #4
0
import pandas
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import matplotlib.widgets as widgets

converters = {'Date': cbook.todate('%Y-%m-%d')}
df = pandas.read_csv('data/CROX.csv', converters=converters)
df = df.sort('Date')
df = df[-500:]  # get the two years or so
df['daily_return'] = df['Adj Close'] / df['Adj Close'].shift(1) - 1


def on_rectangle_select(event_press, event_release):
    'args the press and release events'
    x1, y1 = event_press.xdata, event_press.ydata
    x2, y2 = event_release.xdata, event_release.ydata
    print "RECT: (%3.2f, %3.2f) --> (%3.2f, %3.2f)" % (x1, y1, x2, y2)

    if x1 > x2:
        x1, x2 = x2, x1

    if y1 > y2:
        y1, y2 = y2, y1

    x = df[xfield]
    y = df[yfield]
    # find the region of the dataframe in the selection
    mask = (x >= x1) & (x <= x2) & (y >= y1) & (y <= y2)
    print(df[mask].to_string())
from __future__ import print_function
"""
report how many days it has been since each developer committed.  You
must do an

svn log > log.txt

and place the output next to this file before running

"""
import os, datetime

import matplotlib.cbook as cbook

todate = cbook.todate('%Y-%m-%d')
today = datetime.date.today()
if not os.path.exists('log.txt'):
    print('You must place the "svn log" output into a file "log.txt"')
    raise SystemExit

parse = False

lastd = dict()
for line in file('log.txt'):
    if line.startswith('--------'):
        parse = True
        continue

    if parse:
        parts = [part.strip() for part in line.split('|')]
        developer = parts[1]