Skip to content

Instantly share code, notes, and snippets.

View jayronsoares's full-sized avatar

Jayron Soares jayronsoares

View GitHub Profile
@MaxHalford
MaxHalford / ogd-in-sql.ipynb
Created March 7, 2023 12:32
Online gradient descent written in SQL
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
anonymous
anonymous / correlations.R
Created January 29, 2018 12:44
Code for correlations article
# Detecting correlation
# Defines three functions using base R to illustrate techniques for identifying correlations
# between continuous random variables, then tests against different types of data
# Pearsons r, distance correlation, Maximal Information Coefficient (approximated)
# A simple bootstrap function to estimate confidence intervals
bootstrap <- function(x,y,func,reps,alpha){
estimates <- c()
@dotmanila
dotmanila / clickhouse-changelog.py
Last active February 12, 2022 18:35
Python MySQL Binlog Change Data Capture for Clickhouse Example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import sys
import pymysql.cursors
from pymysqlreplication import BinLogStreamReader
from pymysqlreplication.row_event import (
DeleteRowsEvent,
@amar061996
amar061996 / twitter_user.py
Last active September 18, 2016 18:43
Extracts desired number of tweets from any user on twitter whose twitter username is provided
import tweepy
from tweepy import OAuthHandler
import io
def twitter_user(username,num):
fw=io.open("twitter_user.txt",'a',encoding='utf8')
ckey='Your Consumer Key'
csecrett='Your Consumer Secret'
atoken='Your Access Token'
@mangecoeur
mangecoeur / description.md
Last active March 30, 2021 21:34
Pandas PostgresSQL support for loading to DB using fast COPY FROM method

This small subclass of the Pandas sqlalchemy-based SQL support for reading/storing tables uses the Postgres-specific "COPY FROM" method to insert large amounts of data to the database. It is much faster that using INSERT. To acheive this, the table is created in the normal way using sqlalchemy but no data is inserted. Instead the data is saved to a temporary CSV file (using Pandas' mature CSV support) then read back to Postgres using Psychopg2 support for COPY FROM STDIN.

@jleclanche
jleclanche / weather.py
Created May 13, 2012 19:05
Quick python weather script using Google's Weather API
#!/usr/bin/env python
# encoding: utf-8
import sys
from argparse import ArgumentParser
from xml.dom import minidom
try:
from urllib.request import urlopen
from urllib.parse import urlencode
except ImportError: