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
# requirements: install python packages | |
# importing all required packages, pandas, numpy, matplotlib, seaborn, requests,... | |
import pandas as pd | |
import numpy as np | |
import requests | |
import seaborn as sb | |
import matplotlib.pyplot as plt | |
import os | |
import scrapy |
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
.. | |
<action name="demo"> | |
<shell xmlns="uri:oozie:shell-action:0.1"> | |
<job-tracker>${jobTracker}</job-tracker> | |
<name-node>${nameNode}</name-node> | |
<exec>demo.bash</exec> | |
<argument>${COORDINATOR_ID}</argument> | |
<file>demo.bash#demo.bash</file> | |
</shell> |
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
<coordinator-app | |
name="demo_coordinator" | |
frequency="360" | |
start="2100-12-31T23:59Z" | |
end="2100-12-31T23:59Z" | |
timezone="EST" | |
xmlns="uri:oozie:coordinator:0.2" | |
> | |
<controls> | |
<execution>FIFO</execution> |
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
// Spark version 1.3.0 | |
import org.apache.spark.storage.StorageLevel | |
// Given a query | |
val initial_query = "SELECT * FROM snow_stg.sc_cat_item" | |
// For all the 4 tries below, the dataframe does not get persisted and no entries in the Storage tab of the Spark UI | |
// Try 1 | |
val cmdb_rel_ci = sqlContext.sql(initial_query) |
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
for (i in 1:nrow(air)){ | |
distance <- 999 | |
lat_air <- air[i,"Latitude"] | |
long_air <- air[i,"Longitude"] | |
for(j in 1:nrow(subway)){ | |
dist <- earth.dist(long_air,lat_air,subway[j,"Longitude"],subway[j,"Latitude"]) | |
if(dist < distance){ | |
distance <- dist | |
} |
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
# Read csv file | |
dfName = read.csv("file.csv") | |
# READ CSV FILE WITH DATATYPE DEFINED FOR A CERTAIN COLUMN s | |
dfName <- read.csv("file.csv",colClasses=c("date"="Date")) | |
# WRITE CSV FILE | |
write.csv(dfName, file="file.csv") |
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
//Click on a column to drop down a block. Stack by dropping down multiple blocks in the same column. | |
//You can change the width, height and the amount of columns below. | |
var width = 500; | |
var height = 500; | |
var amount = 10; | |
var data = []; |
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
var svg = d3.select("svg") | |
var circle = svg.append("circle") | |
circle.attr("cx",500) | |
.attr("cy",300) | |
.attr("r",87) | |
.attr("fill","#ff6575") | |
.attr("stroke","#606060") | |
.attr("stroke-width",35) |
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
var canvas = d3.select("svg"); | |
var width = 500; | |
var height = 500; | |
var amount = 12; | |
var data = []; | |
var intervalW = width/amount; | |
var intervalH = height/amount; | |
for (i=0;i<amount;i++){ |
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
var canvas = d3.select("svg"); | |
var width = 500; | |
var height = 500; | |
var amount = 10; | |
var data = []; | |
var intervalW = width/amount; | |
var intervalH = height/amount; | |
for (i=0;i<amount;i++){ |