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
# It is important to know how well the relationship between the values of the x- and y-axis is, if there are no relationship | |
# the polynomial regression can not be used to predict anything. | |
# | |
# The relationship is measured with a value called the r-squared. | |
# The r-squared value ranges from 0 to 1, where 0 means no relationship, and 1 means 100% related. | |
import numpy | |
from sklearn.metrics import r2_score | |
x = [1,2,3,5,6,7,8,9,10,12,13,14,15,16,18,19,21,22] |
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 | |
import matplotlib.pyplot as plt | |
x = [1,2,3,5,6,7,8,9,10,12,13,14,15,16,18,19,21,22] | |
y = [100,90,80,60,60,55,60,65,70,70,75,76,78,79,90,99,99,100] | |
mymodel = numpy.poly1d(numpy.polyfit(x, y, 3)) | |
myline = numpy.linspace(1, 22, 100) |
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
# the x-axis represents car's age, and the y-axis represents car's speed | |
from scipy import stats | |
x = [5,7,8,7,2,17,2,9,4,11,12,9,6] | |
y = [99,86,87,88,111,86,103,87,94,78,77,85,86] | |
slope, intercept, r, p, std_err = stats.linregress(x, y) | |
def myfunc(x): | |
return slope * x + intercept |
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
# This relationship - the coefficient of correlation - is called r. | |
# The r value ranges from -1 to 1, where 0 means no relationship, and 1 (and -1) means 100% related. | |
import matplotlib.pyplot as plt | |
from scipy import stats | |
x = [5,7,8,7,2,17,2,9,4,11,12,9,6] | |
y = [99,86,87,88,111,86,103,87,94,78,77,85,86] | |
slope, intercept, r, p, std_err = stats.linregress(x, y) |
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
'Credit to: https://superuser.com/questions/1291085/delete-all-custom-cell-styles-excel | |
Sub StyleKiller() | |
Dim N As Long, i As Long | |
With ActiveWorkbook | |
N = .Styles.Count | |
For i = N To 1 Step -1 | |
If Not .Styles(i).BuiltIn Then .Styles(i).Delete | |
Next i |
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
DECLARE @SearchStr nvarchar(100) | |
SET @SearchStr = '## YOUR STRING HERE ##' | |
-- Copyright © 2002 Narayana Vyas Kondreddi. All rights reserved. | |
-- Purpose: To search all columns of all tables for a given search string | |
-- Written by: Narayana Vyas Kondreddi | |
-- Site: http://vyaskn.tripod.com | |
-- Updated and tested by Tim Gaunt | |
-- http://www.thesitedoctor.co.uk |
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
SET vPath = '\\servername\folder1\subfolder1'; | |
//Load all sub folders names. | |
//Each folder name includes the corresponding year in its name (last 4 characters) | |
sub DoDir (Root) | |
for each Dir in DirList (Root&'\*' ) | |
tmp: | |
LOAD | |
'$(Dir)' as Dir, | |
Right('$(Dir)',4) as Year |
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
=aggr(if(Rank(Sum(Revenue))<=20,Material),Material) |
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
start "" "C:\Program Files\QlikView\qv.exe" /nodata C:\QvwFolder\File.qvw |
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
SET ThousandSep=','; | |
SET DecimalSep='.'; | |
SET MoneyThousandSep=','; | |
SET MoneyDecimalSep='.'; | |
SET MoneyFormat='$#,##0.00;($#,##0.00)'; | |
SET TimeFormat='h:mm:ss TT'; | |
SET DateFormat='YYYY-MM-DD'; | |
SET TimestampFormat='YYYY-MM-DD h:mm:ss[.fff] TT'; | |
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec'; | |
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun'; |
NewerOlder