| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + # NHSD colours for seaborn | ||
| 2 | + | ||
| 3 | + >Sets seaborn colour palette to NHSD colours. | ||
| 4 | + | ||
| 5 | + - __Description__ : Ensure seaborn graphs adhere to the NHSD brand colours. | ||
| 6 | + - __Published__ : 21/06/2019 | ||
| 7 | + - __Last modified__ : 21/06/2019 | ||
| 8 | + - __Author(s)__ : name@nhs.net | ||
| 9 | + - __Maintainer(s)__ : name@nhs.net | ||
| 10 | + - __Tags__ : seaborn branding python colours | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + """Sets the seaborn colour palette to the NHS Digital colours | ||
| 2 | + """ | ||
| 3 | + import seaborn as sns | ||
| 4 | + | ||
| 5 | + # Set colours | ||
| 6 | + nhsdColours = ["#003087", "#005EB8", "#71CCEF", "#84919C", "#D0D5D6", "#F8F8F8"] | ||
| 7 | + sns.set_palette(nhsdColours) | ||
| 8 | + | ||
| 9 | + # Visualise palette | ||
| 10 | + sns.palplot(sns.color_palette()) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + seaborn==0.9.0 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,25 @@ | |||
| 1 | + import pyodbc | ||
| 2 | + | ||
| 3 | + # pyodbc connection | ||
| 4 | + cnxn = pyodbc.connect('Driver={SQL Server};' | ||
| 5 | + 'Server=GLDMSRV009;' | ||
| 6 | + 'Database=DSS_CORPORATE;' | ||
| 7 | + 'Trusted_Connection=yes;') | ||
| 8 | + | ||
| 9 | + try: | ||
| 10 | + # execute sql through the pyodbc cursor | ||
| 11 | + cursor = cnxn.cursor() | ||
| 12 | + cursor.execute('''BULK INSERT [dbo].[AD_Users2] | ||
| 13 | + FROM 'C:\\Users\wasw1\\Desktop\Python_Scripts\\AD_Users.txt' WITH ( | ||
| 14 | + FIRSTROW = 2, | ||
| 15 | + FIELDTERMINATOR='\\t', | ||
| 16 | + ROWTERMINATOR='\\n' | ||
| 17 | + ); | ||
| 18 | + ''') | ||
| 19 | + except TypeError as error: | ||
| 20 | + print(error) | ||
| 21 | + | ||
| 22 | + # commit transaction | ||
| 23 | + cnxn.commit() | ||
| 24 | + | ||
| 25 | + print("Inserted Successfully") | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + # Title | ||
| 2 | + | ||
| 3 | + >Short description | ||
| 4 | + | ||
| 5 | + - __Description__ : Longer description | ||
| 6 | + - __Published__ : dd/mm/YYYY | ||
| 7 | + - __Last modified__ : dd/mm/YYYY | ||
| 8 | + - __Author(s)__ : name@nhs.net | ||
| 9 | + - __Maintainer(s)__ : name@nhs.net | ||
| 10 | + - __Tags__ : single words separated by spaces | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + seaborn==0.9.0 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,24 @@ | |||
| 1 | + | ||
| 2 | + import pyodbc | ||
| 3 | + | ||
| 4 | + # pyodbc connection | ||
| 5 | + cnxn = pyodbc.connect('Driver={SQL Server};' | ||
| 6 | + 'Server=GLDMSRV009;' | ||
| 7 | + 'Database=DSS_CORPORATE;' | ||
| 8 | + 'Trusted_Connection=yes;') | ||
| 9 | + try: | ||
| 10 | + # Edit the SQL query to align to your table, schema and field constraints | ||
| 11 | + cursor = cnxn.cursor() | ||
| 12 | + cursor.execute('''CREATE TABLE [dbo].[AD_Users2]( | ||
| 13 | + [Name] [nvarchar](50) NOT NULL, | ||
| 14 | + [Pre_Windows_2000_Logon_Name] [nvarchar](50) NOT NULL, | ||
| 15 | + [E_Mail_Address] [nvarchar](50) NOT NULL | ||
| 16 | + ) | ||
| 17 | + ''') | ||
| 18 | + except TypeError as error: | ||
| 19 | + print(error) | ||
| 20 | + | ||
| 21 | + # Commit the transaction to 'save' the changes | ||
| 22 | + cnxn.commit() | ||
| 23 | + | ||
| 24 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + # Title | ||
| 2 | + | ||
| 3 | + >Short description | ||
| 4 | + | ||
| 5 | + - __Description__ : Longer description | ||
| 6 | + - __Published__ : dd/mm/YYYY | ||
| 7 | + - __Last modified__ : dd/mm/YYYY | ||
| 8 | + - __Author(s)__ : name@nhs.net | ||
| 9 | + - __Maintainer(s)__ : name@nhs.net | ||
| 10 | + - __Tags__ : single words separated by spaces | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + seaborn==0.9.0 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments