Skip to content

Instantly share code, notes, and snippets.

@FlameWert
FlameWert / sql_to_dataframe.py
Last active February 3, 2020 23:53
Convert the result of SQL Query into Pandas DataFrame
import pyodbc
import pandas as pd
connection_string = "Driver={SQL Server};Server=localhost;Database=LionKing;Trusted_Connection=yes"
connection = pyodbc.connect(connection_string)
# Remember it is connection and not connection or Connection
# The function name is connection which will return a data type of Connection
query = "SELECT * FROM dbo.Animals"
@FlameWert
FlameWert / Some handy git commands.md
Last active February 4, 2020 07:32
Some handy git commands which I tend to forget easily

Git Commands

To get a remote branch to local

git branch branch_name origin/branch_name

To Unstage all files

git reset

To ignore content of a folder

@FlameWert
FlameWert / Pickling.py
Created February 5, 2020 05:08
Pickle and Unpickle in Python
import pandas as pd
import pickle
browser_market_share = {
"Date": "2020-01",
"Chrome": 64.1,
"Safari": 17.21,
"Firefox": 4.7,
"Samsung Internet": 3.33,
"UC Browser": 2.61,
@FlameWert
FlameWert / PY0101EN-1-1-Types.ipynb
Created February 6, 2020 09:04
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-1-2-Strings.ipynb
Created February 6, 2020 09:40
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-2-1-Tuples.ipynb
Created February 6, 2020 10:16
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-2-2-Lists.ipynb
Created February 6, 2020 10:31
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-2-3-Dictionaries.ipynb
Created February 6, 2020 10:52
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-2-4-Sets.ipynb
Created February 6, 2020 11:13
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-3-1-Conditions.ipynb
Created February 6, 2020 12:09
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.