Creating sample data (with faker) that has a % overlap in Python
A solution I can think of is as follows:

Randomly selecting a number for your 'guarantee' overlapping between 25 and 100
Randomly picking the 'guarantee' number of records from the existing list
Randomly picking the rest of the required records (without considering the existence of the existing list)

This is because your customer_numbers consist of 5 digits, therefore picking these 5 digits randomly for 100 times will generally not create any duplicates with the existing list which has only 100 items. So I think using a way to 'guarantee' the overlapping percentage would work reasonably well. Also, I think it would not be difficult to implement the above steps in Python.
I have 2 tables - customers and purchases
I've used faker to create 100 entries for the customer table with various details of which one is customer_numbers that are unique 5 digits.
I now want to create a table of 100 purchases that reuses the list of customer_numbers but to ensure that there is at least 25% duplicate records.
I am not sure the best way to do this to ensure the 25% requirement.
I initially created a custom function that resamples my original list (using faker.random_elements()) and just takes the first 100 records in the new list but that doesn't ensure a minimum of 25% overlap.
Is there a built in function I can use? If not, what would be the math behind recreating a list with 25% overlaps from an existing list.
Code seems less relevant here but let me know if you need samples.
Solution I went with(not the only one to the problem):

Calculated the number of samples to drop list_size-(list-size/(1*repeat rate))
Dropped the no of samples from the customer list and resampled from the reduced list the number of samples I dropped (with replacement)
Merged the shortened and resampled list

This solution ensures that len(original list) = len(set((new list)))*1.25