<commit_before>#!/usr/bin/python
# coding=utf-8

import pandas as pd
import pandas_datareader.data as web
from datetime import datetime, timedelta, date
import time
import sys
import traceback
import re
from pprint import pprint
import sqlite3
import telepot

ROOT = '/root/git/stock-analyzer/'

# 주식 정보를 위한 루틴
THRESHOLD_RATIO = 10

kospi = pd.read_csv( ROOT+'kospi_201702.csv' )
kospi_codes = kospi.iloc[:,1]

#kosdaq = pd.read_csv( ROOT+'kosdaq_201702.csv')
#kosdaq_codes = kosdaq.iloc[:,1]

codes = []
for c in kospi_codes:
	c = str(c)
	c = '0'*(6-len(c))+c+'.KS'
	codes.append(c)
#for c in kosdaq_codes:
#	codes.append(c+'.KQ')

m2 = timedelta( days = 60 )
end = datetime.now()
start = end - m2

cands = []
for c in codes:
	try:
	    data = web.DataReader( c, 'yahoo', start, end )
	except:
	    print 'error in', c
	    traceback.print_exc()
	else:
	    v = data['Volume']

	    lastDay = v.index[-1]
	    if lastDay.date() != end.date():
	    	# 마지막날이 오늘이 아니면 오늘장은 쉬는 날임.
	    	print "today is off. because last date:", lastDay.date(), 'today:', end.date()
	    	sys.exit(0)
	    	#pass

	    last = v[-1]
	    mean = v[:-1].mean() #워킹데이 기준 59일치 평균
	    ratio = last / mean

	    # 마지막날 올랐는지 체크
	    lastCloseDiff = data['Adj Close'].diff()[-1]

	    print c, ratio, lastCloseDiff
	    if ratio > THRESHOLD_RATIO and lastCloseDiff > 0:
	    	# ratio가 기준을 넘고, 마지막날 주가가 오른 경우
	    	print 'Found !'
	    	cands.append({<commit_msg>add code at log<commit_after>#!/usr/bin/python
# coding=utf-8

import pandas as pd
import pandas_datareader.data as web
from datetime import datetime, timedelta, date
import time
import sys
import traceback
import re
from pprint import pprint
import sqlite3
import telepot

ROOT = '/root/git/stock-analyzer/'

# 주식 정보를 위한 루틴
THRESHOLD_RATIO = 10

kospi = pd.read_csv( ROOT+'kospi_201702.csv' )
kospi_codes = kospi.iloc[:,1]

#kosdaq = pd.read_csv( ROOT+'kosdaq_201702.csv')
#kosdaq_codes = kosdaq.iloc[:,1]

codes = []
for c in kospi_codes:
	c = str(c)
	c = '0'*(6-len(c))+c+'.KS'
	codes.append(c)
#for c in kosdaq_codes:
#	codes.append(c+'.KQ')

m2 = timedelta( days = 60 )
end = datetime.now()
start = end - m2

cands = []
for c in codes:
	try:
	    data = web.DataReader( c, 'yahoo', start, end )
	except:
	    print 'error in', c
	    traceback.print_exc()
	else:
	    v = data['Volume']

	    lastDay = v.index[-1]
	    if lastDay.date() != end.date():
	    	# 마지막날이 오늘이 아니면 오늘장은 쉬는 날임.
	    	print "today is off. because last date:", lastDay.date(), 'today:', end.date(), c
	    	sys.exit(0)
	    	#pass

	    last = v[-1]
	    mean = v[:-1].mean() #워킹데이 기준 59일치 평균
	    ratio = last / mean

	    # 마지막날 올랐는지 체크
	    lastCloseDiff = data['Adj Close'].diff()[-1]

	    print c, ratio, lastCloseDiff
	    if ratio > THRESHOLD_RATIO and lastCloseDiff > 0:
	    	# ratio가 기준을 넘고, 마지막날 주가가 오른 경우
	    	print 'Found !'
	    	cands.append({
{'fraction_non_alphanumeric': 0.14027149321266968, 'fraction_numerical': 0.022276366167768884, 'mean_word_length': 2.986130374479889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2661362', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1340, 'n_words': 313}