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 | |
import json | |
df = pd.read_csv("hierarchies.csv", header=None) | |
def get_hierarchy(jsonobject, value): | |
level3 = df[df[2]==value] | |
if(len(level3)==0): | |
#2 level |
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 datetime import datetime | |
def get_date(s): | |
return datetime.strptime(s, '%b %d %Y %I:%M%p') | |
class A: | |
def __init__(self, a): | |
self.a = a | |
def get_a(self): | |
return self.a |
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
select ENGLISH.orig_eng_ref, ENGLISH.title, ENGLISH.slug, HINDI.slug, | |
ENGLISH.first_published_at as "English Date", | |
HINDI.first_published_at as "Hindi Date", | |
MARATHI.first_published_at as "Marathi Date", | |
URDU.first_published_at as "Urdu Date", | |
BENGALI.first_published_at as "Bengali Date" | |
from | |
(select SPLIT_PART(substring(url_path, length('///categories')),'/',1) as orig_eng_ref, title, wagtailcore_page.slug, first_published_at, language, page_ptr_id from article_article, wagtailcore_page |
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
[ | |
{ | |
"question":"Which candlestick forms a Bullish Engulfing pattern?", | |
"correct":1, | |
"options":[ | |
{ | |
"id":1, | |
"path":"file:///android_asset/Bullish Engulfing.png" | |
}, | |
{ |
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
package deep.learning.cnn; | |
import static java.lang.Math.toIntExact; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.net.URI; | |
import java.util.ArrayList; |
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
package deep.learning.cnn; | |
import static java.lang.Math.toIntExact; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.net.URI; | |
import java.util.ArrayList; |
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
RecordReader csvRecordReader = new CSVRecordReader(0, ','); | |
csvRecordReader.initialize(new FileSplit(new File("temp.csv"))); | |
DataSetIterator csvIterator = new RecordReaderDataSetIterator(csvRecordReader, batchSize, 1, numLabels); | |
System.out.println(csvRecordReader.getLabels()); |
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
List<INDArray> list = new ArrayList<>(); | |
for(int i=0;i<8;i++) { | |
list.add(Nd4j.ones(10, 10, 3)); | |
} | |
INDArray out = Nd4j.create(list, new int[] {8,10,10,3}, 'c'); | |
long[] shape = out.shape(); | |
for(long s: shape) { | |
System.out.println(s); |
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
'Error at [D:/jenkins/ws/dl4j-latest_release-windows-x86_64-cpu/libnd4j/include/ops/declarable/generic/transforms/concat.cpp:133:0]: | |
CONCAT op: all input arrays must have the same rank ! | |
Exception in thread "AMDSI prefetch thread" java.lang.RuntimeException: java.lang.RuntimeException: Op validation failed | |
at org.deeplearning4j.datasets.iterator.AsyncMultiDataSetIterator$AsyncPrefetchThread.run(AsyncMultiDataSetIterator.java:396) | |
Caused by: java.lang.RuntimeException: Op validation failed | |
at org.nd4j.nativeblas.Nd4jCpu$NativeOps.concatFloat(Native Method)' |