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
# coding: utf-8 | |
# In[ ]: | |
# In[1]: |
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
vigate | |
LaTeX_envs | |
Help | |
Autosave interval (min): | |
In [ ]: | |
| |
In [1]: | |
%matplotlib inline |
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
ValueError Traceback (most recent call last) | |
<ipython-input-7-5cf5b03019f2> in <module>() | |
24 model.compile(loss='mean_squared_error', optimizer=optimizer) | |
25 | |
---> 26 model.fit(X_train, y_train, epochs=100, verbose=2) | |
/home/q/anaconda3/envs/p3/lib/python3.6/site-packages/keras/models.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, **kwargs) | |
868 class_weight=class_weight, | |
869 sample_weight=sample_weight, | |
--> 870 initial_epoch=initial_epoch) |
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
1 4 7 |3 6 5 |8 9 2 | |
6 9 5 |8 2 7 |4 1 3 | |
2 3 8 |9 1 4 |6 5 7 | |
------+------+------ | |
9 5 1 |2 8 3 |7 4 6 | |
8 6 4 |1 7 9 |3 2 5 | |
3 7 2 |4 5 6 |9 8 1 | |
------+------+------ | |
4 1 9 |6 3 2 |5 7 8 | |
7 8 6 |5 4 1 |2 3 9 |
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 bs4 import BeautifulSoup | |
from urllib2 import urlopen | |
from datetime import datetime, timedelta | |
from time import sleep | |
import sys | |
import csv | |
# CONSTANTS | |
ESPN_URL = "http://scores.espn.go.com" | |
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
(JFK, SFO, ATL, ORD) = symbols('JFK,SFO,ATL,ORD') | |
(C1, C2, C3, C4) = symbols('C1,C2,C3,C4') | |
(At, In) = symbols('At,In') | |
# (Load, Unload, Fly) = symbols('Load,Unload,Fly,At,In') | |
(P1, P2, P3) = symbols('P1,P2,P3') |
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
def air_cargo_p1() -> AirCargoProblem: | |
cargos = [C1, C2] | |
planes = [P1, P2] | |
airports = [JFK, SFO] | |
pos = [At(C1, SFO), | |
At(C2, JFK), | |
At(P1, SFO), | |
At(P2, JFK), | |
] | |
neg = [At(C2, SFO), |
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
object Solution { | |
def buyTicket(seq: Array[Int]): Array[Int] = { | |
seq.drop(1) ++ seq.take(1).map(_ - 1 ) | |
} | |
def waitingTime(ts : Array[Int], p : Int ) : Int = { | |
var tickets = ts; var time_in_line = 0; var position = p |
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
l = [[1,2],[3,4]] | |
[x for y in l for x in y ] |
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 backtrader as bt | |
import util.data as btu | |
import os | |
def run_stock_scanner(tickers, _from, _to, analyzers): | |
cerebro = bt.Cerebro() | |
for ticker in tickers: | |
DataFactory = btu.get_store().getdata |