This file contains hidden or 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 -*- | |
import json | |
import os | |
import logmatic | |
import logging | |
from logging.config import dictConfig | |
import requests | |
from http import HTTPStatus | |
import re | |
from kiteconnect import KiteConnect |
This file contains hidden or 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
""" | |
Authour : @soyelherein | |
submit via :- | |
$SPARK_HOME/bin/spark-submit pipeline_wo_modules.py | |
""" | |
from pyspark.sql import DataFrame, SparkSession | |
from pyspark.sql.functions import col, lit, coalesce, current_date | |
from pyspark.sql.types import * | |
""" |
This file contains hidden or 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/python | |
import re, urllib, urllib2 | |
class Spreadsheet(object): | |
def __init__(self, key): | |
super(Spreadsheet, self).__init__() | |
self.key = key | |
class Client(object): |
This file contains hidden or 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 matplotlib.pyplot as plt | |
def combined_label(perc, tot): | |
""" | |
Format a label to include by Euros and %. | |
""" | |
return "{0:,.0f}k EUR, {1:.0f}%".format(perc * tot / 1000, perc * 100) | |
def cost_cum(data, focus, subject): |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import mechanize | |
import re | |
from bs4 import BeautifulSoup | |
br = mechanize.Browser() |
This file contains hidden or 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 -*- | |
""" | |
Created on Mon Nov 9 13:11:35 2015 | |
@author: mendox | |
""" | |
import argparse | |
import MySQLdb | |
from prettytable import PrettyTable |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
__author__ = 'c_thv' | |
#path = 'c:/users/c_thv/desktop/ban.csv' | |
import csv | |
#print result[0][1] #row number and the col like RC style | |
infile=(list(csv.reader(open('c:/users/c_thv/desktop/ban.csv',"rb")))) #loading the file in numpy | |
x = dict([(row[0], row[1:]) for row in infile]) #Devlop a dict as InFile | |
outfile=(list(csv.reader(open('c:/users/c_thv/desktop/thi.csv',"rb")))) |
This file contains hidden or 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
__author__ = 'c_thv' | |
__path__ = "c:/users/c_thv/desktop/de.csv" | |
import csv | |
import numpy | |
# x = {} | |
# #loading the file in numpy | |
# result=numpy.array(list(csv.reader(open("c:/users/c_thv/desktop/de.csv","rb"),delimiter=','))).astype('string') | |
# #print result[0][1] #row number and the col like RC style | |
# for i in result: |
This file contains hidden or 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 urllib2 | |
url="http://groupon.com" | |
page =urllib2.urlopen(url) | |
data=page.read() | |
print data |