 Hello, welcome to SS Unitex to see this side and this is continuation of PySpark tutorial. So in this video we are going to see about two array type functions. So first is the array repeat and second is the array position. So as per the today's azenda first we will see about the array repeat then we will see array position. So what array repeat function will do? So array repeat is used to repeat array end time. So end time is nothing but we will be going to pass a parameter how many times array we want to repeat. In other word it will be going to duplicate the array and replace end times across all rows in array type column. So let's assume we are having a array type column and how many times array view we want to replicate we can specify so array repeat will help us there. Next is the array position. So array position function will help us to get the position of any character inside particular array. So on that scenario we can use the array position. What is the real time use of these two functions? So array repeat can be used while we are going to create the test data and array position can be used into multiple places. Let me quickly go inside the browser and we will try to see in practical. So here as you can see we are having one of the data frame that is df1 that we have created it will be having total two columns first is the id column second is the full name. Inside the full name you can see we are having the first name middle name last name like that in an array. So here on the zero index we are having a similarly in the second row we can see index zero one two so zero for the first name one for middle name two for last name so like that we are having the values. Now let me try to execute this so it will be creating data frame df. Now first let me try to use array repeat function so simply we can use df.select let me select the columns so I am going to select the id column first comma df.let me select the full name comma df. here I am going to use array repeat function so array repeat function first we have to import so let me try to use from pyspark.sql.funcels then we can go import let me import all the function. So now we can use array repeat function that you can see here now first parameter as it is asking the column name so what is the column name df.fullname put comma second parameter it is asking the count how many times we want to replicate this array so let me try to replicate two times let me try to put this into another data frame that is df one and let me display this df one here let me execute this cell so here okay so here we have used df. so that should not be used array repeat function will be used inside that we can specify the column let me try to execute and we will see the output of this so here we can see a has repeated two times so you can see on index 0 and 1 we are having a twice similarly for other array type values has been repeated now let me try to repeat this into three times so we can execute and we will see three times it is repeated so I hope you can understood how we can use array repeat function now next let me try to use array position function so for that let me use df.select and inside that let me select this column full name put comma in the second we can use array underscore position so we can see first parameter it is asking about the column name so what is the column name column name is nothing but the full name second it is asking the value which value we just want to check so we just want to check value k what is the position for k let me put this into another data frame and use display of df2 let me execute and we will see the output of this so as we can see here we don't have k so that's why we can see 0 here we don't have k that's why we can see 0 here we can see k position first because it's starting from left side so here it's 1 similarly for k we can see 1 here we don't have k so we can see 0 let me try to find out a so let me execute here we can see a that is 1 here we can see a is available in second position so that's why we can see 2 here so I hope guys you have understood how we can use array repeat function and array position function so thank you so much for watching this video see you in the next video