Association Rule
Confidence
Example
![]() |
| Our Transactions/Baskets |
![]() |
| Our Transactions/Baskets |
#!/usr/bin/python
strA = "Hello "strB = 'World!'
#Printing the above variables on screen
print strA #This will work in Python2print strB #This will work in Python2print( strA ) #This will work in Python3print( strB ) #This will work in Python3![]() |
| Result of above Python3 Code |
#!/usr/bin/python
print( strA[0] ) #prints the first character of variable strA
print( strA[1:3] ) #prints characters from first index to third
print( strA[3:] ) #prints characters from third index#!/usr/bin/python
print( "Print Concatenated Output: " + strA + strB )![]() |
| Code Output |
#!/usr/bin/python
print( strA + 4 ) #This will give an error as mentioned above
#Correct Way to Concat String and another Datatype
print( strA, 4 ) #Method 1print( strA + str(1234) ) #Method 2
#!/usr/bin/python
"""You can have multiple formatting operators, but remember the sequence of variables must be followed after % inside a bracket () separated by comma"""
num = 2post_num = 129
print( "Code %s Learn" %num)
print( "Code %s Learn\'s post number: %s" %(num,post_num))![]() |
| String Formatting Example Output |
python --version. If this gives you a result of python 2.7.6 (2.7.*) then don't worry, we are not done yet.open ~/.bash_profile. If this gives a "Not Found" error, just make the file by typing: touch ~/.bash_profile. This will create the file.alias python="python3"
source ~/.bash_profile. This will apply the changes you made in your file.![]() |
| Infographic is from Domo, a data visualizing firm. |
We have already seen Tutorial Primary Index and we have understood how Primary Index work and how they us in maximizing performance.
Today we will be learning on how to choose Primary Index/Indexes in a given table. But before we move ahead in defining the criteria for choice of Primary Index, here is a Tip:
If you don't define any Index on a Table, then Teradata decides on its own. Its makes decision on the below points:
1. If you have any column with Primary Key Constraint in the table definition, Teradata will make column as Unique Primary Index.
2. If you have a/many columns with Unique Constraint, then Teradata will choose only the 1st column in the table definition as Unique Primary Index & others as Unique Secondary Index.
3. If you don't have column with defined as either Primary key or with Unique Constraint, then Teradata makes the 1st column in the table definition as Non Unique Primary Index.
By Access Demographics we mean, those columns which were used by the user to access the table, i.e. columns used in the WHERE clause of the SQL Statement. So choose the column(s) which were most frequently used for access to maximize the number of one-AMP operation. We need to consider both value as well as join access
So as we know from our previous post on Primary Indexes, More unique the index, the better the distribution. Optimizing distribution optimizes parallel-processing.
You must understood if you know the meaning of the word Volatile. This point means that we have to choose a column which will have a low change rate. The Primary Index should not at all be volatile because any changes in the PI will result in heavy I/O overhead i.e. as a result in change the PI has to be moved from one AMP to another. Therefore, we have to choose a column which will have stable values.
**Note**
There is a trade-off between the access & distribution demographics. The most desirable situation is to find a column which has a good access and good distribution demographics.