Even the most experienced coders will search Google for information .
I re searched the simple lines of code I've been using , With a quick reminder grammar . In this sense , I am really writing this article for myself . These are the most common things I use repeatedly as a data generalist Python code snippet .
( All the following examples use Python 3.6 Or later )
import pyodbc
import csv
import pandas as pd
#### DATABASE CREDENTIALS ####
server = 'SERVERNAME'
database = 'DATABASENAME'
username = 'USER'
password = 'PASSWORD'
conn = pyodbc.connect('DRIVER={DRIVER NAME WITH BRACKETS INCLUDED};SERVER='+server+';
DATABASE='+database+';UID='+username+';PWD='+ password)
conn_str = 'DRIVER={DRIVER NAME WITH BRACKETS INCLUDED};SERVER='+server+';
DATABASE='+database+';UID='+username+';PWD='+ password
cursor = conn.cursor()
#### CREATE A F