Skip to content

Instantly share code, notes, and snippets.

View KushalVenkatesh's full-sized avatar

kvenkat KushalVenkatesh

View GitHub Profile
-- Window Function examples
-- PostgreSQL conference South Africa 2018
-- By Willem Booysen
-- Youtube: https://www.youtube.com/watch?v=blHEnrYwySE
-- Create database and templates for demo
DROP DATABASE IF EXISTS WindowFunctions;
CREATE DATABASE WindowFunctions;
@rain-1
rain-1 / example.tsv
Last active February 22, 2025 20:24
Tab Separated Values file format specification version 2.0
Name Age Address
Paul 23 1115 W Franklin
Bessy the Cow 5 Big Farm Way
Zeke 45 W Main St
numbers = [23, 57, 10, 10, 12, 35, 2, 74, 302, 10]
# Repalce the "None" values with your solutions
# Use NumPy to calculate the values for each variable
mean = None
median = None
standard_deivation = None
sorted_numbers = None
numbers_sum = None
# Tests
@supriya-gdptl
supriya-gdptl / UninstallTensorFlow.txt
Created December 5, 2017 14:07
Steps to uninstall tensorflow
pip show tensorflow
pip uninstall tensorflow
# Tensorflow 1.4 works only with Python 3.5
# to install downgrade Python 3.6 to Python 3.5 in Anaconda
conda install python=3.5
# now install tensorflow 1.4
sudo apt-get install python3-pip python3-dev
pip install tensorflow
@dre4success
dre4success / cloudSettings
Last active July 22, 2019 17:21
Given an unsorted array of n elements, find if the element k is present in the given array or not. return 'YES' or 'NO'
{"lastUpload":"2019-07-22T17:21:44.605Z","extensionVersion":"v3.4.1"}
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
app = dash.Dash()
df = pd.read_csv(
'https://gist.githubusercontent.com/chriddyp/'
@simecek
simecek / rmagic_example.ipynb
Last active January 16, 2021 13:29
How to add R code to your (IPython) Jupyter Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mahermalaeb
mahermalaeb / surprise_tutorial.py
Last active November 21, 2019 02:03
The easy guide for building python collaborative filtering recommendation system in 2017
import zipfile
from surprise import Reader, Dataset, SVD, evaluate
# Unzip ml-100k.zip
zipfile = zipfile.ZipFile('ml-100k.zip', 'r')
zipfile.extractall()
zipfile.close()
# Read data into an array of strings
with open('./ml-100k/u.data') as f:
#Mining YouTube using Python & performing social media analysis (on ALS ice bucket challenge)
#https://www.analyticsvidhya.com/blog/2014/09/mining-youtube-python-social-media-analysis/
#complete Python script to mine YouTube data. Just replace your key and keyword you want to search
from apiclient.discovery import build #pip install google-api-python-client
from apiclient.errors import HttpError #pip install google-api-python-client
from oauth2client.tools import argparser #pip install oauth2client
import pandas as pd #pip install pandas
import matplotlib as plt
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import os
def computeCost(X, y, theta):
inner = np.power(((X * theta.T) - y), 2)
return np.sum(inner) / (2 * len(X))
def gradientDescent(X, y, theta, alpha, iters):