Skip to content

Instantly share code, notes, and snippets.

View QuantTraderEd's full-sized avatar
🤔
Let me think..

QuantTraderEd

🤔
Let me think..
View GitHub Profile
import bs4
html_text_file = "miniarb_research_20180713.html"
f = open(html_text_file, 'r')
html_text = f.read()
f.close()
soup = bs4.BeautifulSoup(html_text)
@QuantTraderEd
QuantTraderEd / read_in.py
Last active September 26, 2017 05:39
read_out py & read_in.py
# -*- coding: utf-8 -*-
import zlib
import base64
file_path = 'c:/python'
filename = 'encoded_text.text'
filename_write = 'write_in.py'
with open(file_path + '/' + filename, 'r') as f:
@QuantTraderEd
QuantTraderEd / test_text.txt
Created June 1, 2017 14:58
Create via API
test_text
@QuantTraderEd
QuantTraderEd / pgist.py
Created May 31, 2017 15:19
scipt what upload file to gist
# -*- coding: utf-8 -*-
import json
filename = 'pgist.py'
# 1. make content
with open(filename, 'r') as f:
line_lst = f.readlines()
@QuantTraderEd
QuantTraderEd / file1.txt
Created May 31, 2017 14:14
Created via API
Demo
@QuantTraderEd
QuantTraderEd / lypython.hpp
Last active December 31, 2019 14:51
boost python helper
#include <boost/python.hpp>
#include <boost/python/stl_iterator.hpp>
#include <vector>
#include <unordered_map>
namespace lymc {
namespace python = boost::python;
@QuantTraderEd
QuantTraderEd / Makefile
Last active August 29, 2015 14:23
R stat
SrcSuf = cxx
ObjSuf = o
OutPutOpt = -o
SoSuf = so
#=======================================
R_HOME := $(shell R RHOME)
RCPPFLAGS := $(shell $(R_HOME)/bin/R CMD config --cppflgs)
RLDFLAGS := $(shell $(R_HOME)/bin/R CMD config --ldflags)
RBLAS := $(shell $(R_HOME)/bin/R CMD config BLAS_LIBS)
import numpy as np
import time
m1 = np.mat(np.random.rand(2800, 2800))
m2 = np.mat(np.random.rand(2800, 2800))
t = time.time(); m3 = m1 * m2; print time.time() - t
@QuantTraderEd
QuantTraderEd / ETFArbTest.py
Last active August 29, 2015 14:21
ETFArbTest
# -*- coding: utf-8 -*-
"""
Created on Tue May 26 11:07:33 2015
@author: assa
"""
import pandas as pd
import sqlite3 as lite
@QuantTraderEd
QuantTraderEd / EigenPort2.py
Last active August 29, 2015 14:20
EigenPort
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 30 12:44:08 2015
@author: assa
"""
import numpy as np
import pandas as pd