Last active
January 31, 2025 06:09
-
-
Save Taresin/aa7cfd77624069a28f77444f167b89dd to your computer and use it in GitHub Desktop.
Creating a random set of Tinder users and pairing them up in dates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a | b | |
---|---|---|
98 | 43 | |
39 | 93 | |
28 | 99 | |
28 | 41 | |
74 | 51 | |
74 | 48 | |
18 | 30 | |
51 | 10 | |
51 | 44 | |
38 | 73 | |
99 | 6 | |
64 | 27 | |
36 | 28 | |
96 | 86 | |
96 | 61 | |
24 | 90 | |
27 | 96 | |
27 | 29 | |
88 | 82 | |
77 | 97 | |
34 | 33 | |
70 | 96 | |
80 | 20 | |
78 | 90 | |
78 | 55 | |
25 | 17 | |
10 | 16 | |
86 | 7 | |
86 | 10 | |
83 | 67 | |
3 | 71 | |
3 | 91 | |
57 | 100 | |
57 | 56 | |
87 | 21 | |
56 | 14 | |
56 | 7 | |
67 | 50 | |
67 | 80 | |
41 | 5 | |
41 | 88 | |
46 | 61 | |
46 | 85 | |
4 | 15 | |
100 | 84 | |
23 | 9 | |
65 | 16 | |
65 | 59 | |
48 | 49 | |
75 | 6 | |
75 | 94 | |
50 | 33 | |
90 | 65 | |
90 | 2 | |
44 | 21 | |
7 | 75 | |
7 | 53 | |
8 | 79 | |
8 | 52 | |
33 | 43 | |
33 | 83 | |
72 | 66 | |
72 | 64 | |
60 | 87 | |
13 | 87 | |
13 | 94 | |
69 | 99 | |
69 | 91 | |
31 | 82 | |
43 | 45 | |
81 | 76 | |
81 | 79 | |
35 | 40 | |
35 | 2 | |
89 | 26 | |
2 | 54 | |
73 | 95 | |
73 | 63 | |
66 | 100 | |
66 | 9 | |
58 | 33 | |
58 | 22 | |
54 | 9 | |
40 | 90 | |
14 | 47 | |
26 | 41 | |
26 | 46 | |
30 | 70 | |
30 | 3 | |
68 | 21 | |
68 | 45 | |
22 | 20 | |
82 | 75 | |
62 | 67 | |
37 | 30 | |
37 | 96 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from faker import Faker | |
import random | |
user_file = open("output/users.csv", "w") | |
user_file.write("id,name,date_of_birth") | |
dates_file = open("output/dates.csv", "w") | |
dates_file.write("a,b") | |
# Generate users | |
fake = Faker() | |
users = [] # Store users in this list | |
for _id in range(1, 101): | |
is_male = random.random() > 0.5 | |
name = fake.name_male() if is_male else fake.name_female() | |
date_of_birth = fake.date_of_birth(minimum_age=18, maximum_age=65) | |
users.append({'id': _id, "name": name, "date_of_birth": date_of_birth}) | |
random.shuffle(users) | |
remaining_users = users.copy() | |
while len(remaining_users) > 0: | |
# Get the first user in the list | |
user = remaining_users.pop(0) | |
# Store the first user into the CSV | |
user_file.write("\n") | |
user_file.write(f"{user['id']},{user['name']},{user['date_of_birth']}") | |
for i in range(random.randint(0, 2)): | |
# Get a random user from the list | |
random_user = random.choice(users) | |
if random_user == user: | |
continue | |
# Store the relationship between the user and the random user | |
dates_file.write("\n") | |
dates_file.write(f"{user['id']},{random_user['id']}") | |
user_file.close() | |
dates_file.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD CSV WITH HEADERS FROM 'file:///users.csv' AS line | |
MERGE (p:Person {id: line.id, name: line.name, date_of_birth: line.date_of_birth}) | |
RETURN p; | |
LOAD CSV WITH HEADERS FROM 'file:///dates.csv' AS line | |
MATCH (p1:Person {id: line.a}) | |
MATCH (p2:Person {id: line.b}) | |
CREATE (p1)-[:DATED]->(p2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id | name | date_of_birth | |
---|---|---|---|
98 | Sherri Townsend | 2006-03-04 | |
93 | Todd Caldwell | 1970-08-17 | |
1 | Crystal Bryant DVM | 1987-11-24 | |
91 | Steven Mcdowell | 1982-11-14 | |
39 | April Berger | 1965-03-29 | |
95 | Shannon Johnson | 1964-12-31 | |
28 | Sara Brown | 1959-10-16 | |
74 | Kimberly Mendoza | 1966-11-29 | |
18 | Anna Nelson | 1991-02-16 | |
63 | Miss Victoria Rogers | 1999-04-09 | |
51 | Kelsey Gomez | 2005-09-06 | |
71 | Carrie Glover | 1963-07-01 | |
38 | Kristin Hernandez | 2005-11-14 | |
99 | Deborah Vasquez | 1993-05-01 | |
64 | Jonathan Boyd | 1996-11-19 | |
16 | Pamela Martinez | 1968-07-01 | |
36 | Timothy Conner | 1962-10-07 | |
96 | Kimberly Baker | 1964-07-14 | |
24 | Caitlin Davies | 1959-12-23 | |
27 | Brittany Allen | 1969-10-21 | |
88 | Jamie Scott | 1979-09-03 | |
77 | Douglas Schultz | 1990-12-29 | |
34 | Courtney Holland | 1971-03-15 | |
70 | Sandra Brown | 1959-10-14 | |
80 | Nicole Ruiz | 1991-06-30 | |
11 | Sophia Simmons | 1989-05-28 | |
55 | Jennifer Stephenson | 1973-03-21 | |
78 | Elizabeth Lopez | 1969-02-20 | |
94 | Richard Jackson | 1999-03-23 | |
97 | Tonya Villa | 1963-11-03 | |
25 | Rebecca Cooper | 1974-05-18 | |
79 | Danielle Gould | 1980-11-27 | |
5 | Danny Jones | 1980-03-22 | |
6 | Donald Martin | 1994-01-08 | |
10 | Brian Maldonado | 2005-10-15 | |
86 | Ricardo Green | 1975-07-24 | |
83 | Kelly Perez | 1974-09-21 | |
3 | Kathy Moss | 1997-08-26 | |
53 | Jennifer Williams | 1968-12-07 | |
57 | Stephanie Mason | 1980-11-15 | |
17 | Ernest Tucker | 1972-04-27 | |
87 | Nicole Lee | 1961-11-19 | |
59 | Daniel Jones | 2003-07-16 | |
56 | Margaret Garza | 1968-04-07 | |
67 | Shawn Cervantes | 1980-04-13 | |
41 | Andrew Garner | 2005-11-28 | |
46 | Victoria Thomas | 1992-07-08 | |
4 | Roy Gonzalez | 1959-05-05 | |
100 | Alice Coleman | 1998-07-31 | |
52 | Emily Moore | 1972-06-14 | |
23 | Alexis Rivera | 2005-10-29 | |
65 | Alexandria Valenzuela | 1968-01-31 | |
92 | Lisa Roth | 1996-01-03 | |
48 | Phillip Nichols | 1963-08-06 | |
19 | Steven Anderson | 1965-03-11 | |
76 | Elizabeth Wagner | 1966-04-02 | |
15 | Troy Smith | 2002-12-09 | |
32 | Russell Carrillo | 2004-08-20 | |
75 | Mr. Jesse Clark | 1993-07-13 | |
50 | Summer Herrera | 1960-12-08 | |
90 | Tristan Berry | 1976-09-17 | |
49 | Chelsea Williams | 1978-05-26 | |
9 | James White | 1986-07-03 | |
44 | Kayla Malone | 1986-02-10 | |
45 | Tara Jenkins | 1963-07-05 | |
61 | Crystal Berry | 1979-06-25 | |
7 | Gregory Lyons | 1969-11-28 | |
84 | Brett King | 1970-02-26 | |
8 | Kenneth Wood | 1965-01-01 | |
33 | Tina Johnson | 1976-04-28 | |
72 | Rebecca Larsen | 1996-04-12 | |
60 | Terry Cook | 2005-10-12 | |
13 | Linda Hart | 1991-05-01 | |
69 | Mark Stokes | 1975-01-09 | |
31 | Andrew Shaw | 1966-10-23 | |
20 | Robert Moore | 1991-08-04 | |
43 | Chase Mccarthy | 1961-08-03 | |
81 | Christian Holland | 1976-05-02 | |
35 | Andre Rodgers | 1967-06-30 | |
89 | Michelle Hall | 1979-03-14 | |
2 | Steven Horn | 1970-11-09 | |
73 | Jessica Ewing | 1973-05-09 | |
66 | James Rice | 1977-09-07 | |
58 | Robert Martinez | 1998-02-22 | |
47 | Donald Franklin | 2001-12-27 | |
54 | Gregory Sherman | 2000-01-28 | |
40 | Barbara Mcclain | 1980-10-16 | |
14 | Anna Woodward | 1981-12-29 | |
26 | Calvin White | 1991-05-27 | |
85 | Brandy Pope | 1998-10-20 | |
30 | Parker Phillips | 1960-08-01 | |
68 | Jonathan Fox | 1975-06-17 | |
22 | Michelle Nguyen MD | 1987-01-22 | |
12 | Charles Powers | 1985-07-11 | |
82 | Briana Medina | 1995-04-16 | |
62 | Michael Griffin | 1978-08-30 | |
37 | Marie Hampton | 1981-11-02 | |
21 | Michael Mitchell | 1986-09-06 | |
42 | Crystal Hernandez | 1984-11-02 | |
29 | Kyle Best | 1973-06-21 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment