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
-- 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; |
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
Name | Age | Address | |
---|---|---|---|
Paul | 23 | 1115 W Franklin | |
Bessy the Cow | 5 | Big Farm Way | |
Zeke | 45 | W Main St |
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
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 |
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
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 |
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
{"lastUpload":"2019-07-22T17:21:44.605Z","extensionVersion":"v3.4.1"} |
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 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/' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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: |
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
#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 |
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 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): |
NewerOlder