This file contains 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
from news_corpus_builder import NewsCorpusGenerator | |
from pprint import pprint | |
import sys | |
# Location where you want to save the news articles | |
corpus_dir = '/home/skillachie/Development/event_articles' | |
category_total = 300 | |
extractor = NewsCorpusGenerator(corpus_dir,'file') |
This file contains 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
import pandas as pd | |
unique = [1,2,3,4,5,6,7,8,9,10,11,12,13,51,52,55] | |
df1= pd.qcut(unique,10,[1,2,3,4,5,6,7,8,9,10]) | |
print df1 | |
print 'works' | |
# represents cases when we simply have 0/na for some deciles | |
# Need to fix | |
non_unique = results = [1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,5] |
This file contains 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
import pandas as pd | |
from pprint import pprint | |
import numpy as np | |
df = pd.DataFrame.from_csv('nlp_binary_features_business_days.csv') | |
pprint(df.isnull().sum()) | |
#pprint(df) | |
~ | |
~ |
This file contains 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
from finsymbols import get_sp500_symbols | |
symbols = get_sp500_symbols() | |
for symbol in symbols: | |
print symbol['symbol'] |
This file contains 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 | |
import pika | |
import sys | |
connection = pika.BlockingConnection(pika.ConnectionParameters( | |
host='localhost')) | |
channel = connection.channel() | |
This file contains 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 | |
import pika | |
import sys | |
#Example publisher code take from RabbitMQ topic tutorial | |
routing_key = sys.argv[1] if len(sys.argv) > 1 else 'anonymous.info' | |
message = ' '.join(sys.argv[2:]) or 'Hello World!' | |
channel.basic_publish(exchange='data_gateway', | |
routing_key=routing_key, |
This file contains 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 | |
import pika | |
import sys | |
connection = pika.BlockingConnection(pika.ConnectionParameters( | |
host='localhost')) | |
channel = connection.channel() | |
This file contains 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
from celery import Celery | |
import time | |
#Specify mongodb host and datababse to connect to | |
BROKER_URL = 'mongodb://localhost:27017/jobs' | |
celery = Celery('EOD_TASKS',broker=BROKER_URL) | |
#Loads settings for Backend to store results of jobs | |
celery.config_from_object('celeryconfig') |
This file contains 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
from celery.schedules import crontab | |
CELERY_RESULT_BACKEND = "mongodb" | |
CELERY_MONGODB_BACKEND_SETTINGS = { | |
"host": "127.0.0.1", | |
"port": 27017, | |
"database": "jobs", | |
"taskmeta_collection": "stock_taskmeta_collection", | |
} |
This file contains 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/ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'image_sorcery' | |
require 'mini_magick' | |
# -- Obtain metainfo via 'fetch-ebook-meta'a | |
#NOTE cover image for books gets saved to the curent working directory of the script. |