Skip to content

Instantly share code, notes, and snippets.

View cloud-techs's full-sized avatar

cloud-tech cloud-techs

View GitHub Profile
test_string = " test string for TUTORIAL "
test_string_2 = "this is second string"
test_string_3 = "this-is-test-sting-for-splitting"
# How to change all words to uppercase
print(test_string.upper())
# How to change all words to lowercase
print(test_string.lower())
# How to make first letter capital
from bs4 import BeautifulSoup
test_html = '''
<div class="col-md-4 menuFootNote">
<div class="content">
<a href="https://www.example.com/option-chain">
<figure>
<img src="https://static.example.com/s3fs-public/2019-07/option-chain_0.png" alt="Option Chain">
</figure>
<h4>Option Chain</h4>
from bs4 import BeautifulSoup
test_html = '''
<div class="col-md-4 menuFootNote">
<div class="content">
<a href="https://www.example.com/option-chain">
<figure>
<img src="https://static.example.com/s3fs-public/2019-07/option-chain_0.png" alt="Option Chain">
</figure>
<h4>Option Chain</h4>
from bs4 import BeautifulSoup
test_html = '''
<div class="col-md-4 menuFootNote">
<div class="content">
<a href="https://www.example.com/option-chain">
<figure>
<img src="https://static.example.com/s3fs-public/2019-07/option-chain_0.png" alt="Option Chain">
</figure>
<h4>Option Chain</h4>
# install libraries
import tensorflow as tf
import numpy as np
print(tf.__version__)
#Generate sample data
X = tf.constant(value = np.linspace(0,2,1000), dtype = tf.float32)
Y = 5* X + 30
# create variables for weight and bias
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ title }}</title>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/bokeh/1.2.0/bokeh.min.css"
rel="stylesheet" type="text/css">
import numpy as np
from flask import Flask, request, render_template, abort, Response
from bokeh.plotting import figure
from bokeh.embed import components
app = Flask(__name__)
@app.route('/')
def index():
x = np.arange(2, 50, step=.5)
import psycopg2
def load_data_into_table(query):
dbname = "test_db"
username = "test_user"
pwd = "test_pwd"
conn = psycopg2.connect(user=username, password=pwd, host="localhost",
port="5432", database=dbname)
curr = conn.cursor()
curr.execute(query)
import psycopg2
def create_test_tables(table):
dbname = "test_db"
username = "test_user"
pwd = "test_pwd"
conn = psycopg2.connect(user=username, password=pwd, host="localhost",
port="5432", database=dbname)
curr = conn.cursor()
create_table = f""" CREATE TABLE IF NOT EXISTS {table}