Question: Making a calendar with JavaScript, how can I make it so that the loop starts in a specific date at 1 and not just hide the index.

for example, when I select february it starts at Wednesday with the number 4, I just want the 4 to become a 1 and count upwards, I don't really care about the positioning at the moment.

Please help

```
    <script>
        for (var i = 12; i > 0; i--) {
            var select = document.getElementById("month");
            var option = document.createElement("option");
            option.value = i - 1;
            option.innerText = i;
            select.appendChild(option);
        }
        for (var i = 2019; i > 1899; i--) {
            var select = document.getElementById("year");
            var option = document.createElement("option");
            option.value = i - 1;
            option.innerText = i;
            select.appendChild(option);
        }
        function printDays(){
            var days = document.getElementById("days");
                days.innerHTML = '';
            var month = document.getElementById("month").value;
            var year = document.getElementById("year").value;
            var date = 32 - (new Date(year , month , 32).getDate());
            var day = new Date(year , month).getDay();
            var d = 0;
            var d1 = 0;
            console.log(day);
            for (var i = 0; i < 5; i++) {
                var tr = document.createElement("tr");
                    for (var j = 0; j < 7; j++) {
                        d++;
                        d1++;
                        var td = document.createElement("td");
                            if(d1 >= day && d <= date){
                                td.innerText = d;
                            }
                        tr.appendChild(td);
                    }
                days.appendChild(tr);
            }
        }
    </script>

```

Answer: 
The error message says that your column `stopped` is of type `array<string>` rather than `string`. You need a string column for `regexp_replace`. 

In order to apply if to an array of strings you can first create a string out of the array and then split that string again

```py
def removePunctuation(column):
     return split(trim(lower(regexp_replace(concat_ws("SEPARATORSTRING", column),'[^\sa-zA-Z0-9]', ''))), "SEPARATORSTRING").alias('stopped')

```
Here is an alternate approach:

`from pyspark.sql.functions import *`

`df=pysparkDF.withColumn('someColOfStrings', translate('someColOfStrings', '!"#$%&\'()*+,-./:;<=>?@[\\]^_{|}~', ''))`

`tokenizer = Tokenizer(outputCol="textTokens")`

`tokenizer.setInputCol("someColOfStrings")`

`df1=tokenizer.transform(df.dropna())`

With this code, you can tokenize the values in the strings after you remove the punctuations.