Question: I have:

```
points <- read_xlsx ("Data / PC-2021050200.xlsx", sheet = "coordinate")

```

Earlier in the code, I put the date "2021-05-02" which is a variable.
How to enter date as a variable in the file path?

Answer: 
I like to use random generators directly. While python's random module is decent, with other languages I had some problems, e.g. when generating points in multidimensional space, some patterns were occurring.

Python support conversion to decimal integer from a base 36 numeral. So, to constraint the min value, convert string to integer and user *randint*, which readily supports intervals.

Conversion of regular base 10 integer into base 36 is more tricky, luckily you can use an additional library such or numpy or active state snipped from <https://code.activestate.com/recipes/65212/>. I just copied a sniped from an older stackoverflow answer, it was discussed many times, and more compact than activestates'.

```
import string
import random

alphabet = string.digits + string.ascii_uppercase
N = len(alphabet) # 36
MAX1 = int('0000WXYZ', N) + 1
MAX2 = int('ZZZZZZZZ', N)

digs = alphabet

def int2base(x, base):
    digits = []
    while x:
        digits.append(digs[int(x % base)])
        x = int(x / base)
    digits.reverse()
    return ''.join(digits)

r = int2base(random.randint(MAX1, MAX2), N)
if len(r) < 8:  # pad with 0 if needed
    r = rjust(r, '0')

```

Disclaimer. The python random number generator is quite good, yet, it is possible, since there is only so many unique string of the length 8. I run a few tests and usually it takes anywhere from a hundred thousand to a few millions. Even with a truly random numbers, you can get just anything, even duplicate, just try to toss a coin or roll a dice several times in row. Note, it is not great idea to update your the MAX each time as you will exhaust the list and reach the ZZZZZZZZ very soon (probably less than 30). If you feel strongly compelled 100% prevent duplicates, just build a list/set of already used strings, yet it is highly unlikely, unless MAX is close to ZZZZZZZZ.
You can use this to create unique combinations:

```
from itertools import permutations
alphabet = '0123456789abcdefghijklmnopqrstuvwxyz'
permutations(alphabet, 8)

```

If you want to draw random but continuously increasing numbers from all possible but unique entries you could try this:

```
# Get maximum of possible entries:
from functools import reduce
import operator
import math

counts = [8,36]
permuations = int(math.factorial(sum(counts))/reduce(operator.mul, map(math.factorial, counts), 1))

# Generate all possible entries (generator)
from itertools import permutations, islice
alphabet = '0123456789abcdefghijklmnopqrstuvwxyz'
g = permutations(alphabet, 8)

# select a list of random indexes to retrieve
from random import sample, seed
n = 5
seed(101)
lst = sorted(sample(range(0, permuations), 5))

# print 5 values from the original generator based on the random indexes
for i in lst:
    print(next(islice(g, i, None)))

```

Essentially you create all possible permutations (unique combinations) then you create a list of random but unique index. Now you order the index, which is why the outcome will always be increasing. Then you match the index by their coresponding value of all possible permutations.