Skip to content

Commit 0edbdf6

Browse files
authored
Merge pull request mouredev#7342 from pyramsd/reto#38
mouredev#38 - python
2 parents a54f8e9 + 347b4bf commit 0edbdf6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import pandas as pd
2+
3+
cvs_file = "D:\\Programacion\\registros.csv"
4+
5+
df = pd.read_csv(cvs_file)
6+
7+
print("Participantes:")
8+
print(df)
9+
10+
emails_activos = df[df["status"] == "activo"][["id", "email"]]
11+
12+
ganadores = emails_activos.sample(3)
13+
categorias = ["ganador de una suscripción", "ganador de un descuento", "ganador de un libro"]
14+
15+
print("\nGanadores:")
16+
17+
for index, (row, categoria) in enumerate(zip(ganadores.iterrows(), categorias)):
18+
_, ganador = row
19+
print(f"ID: {ganador['id']}, Email: {ganador['email']} -> {categoria}")

0 commit comments

Comments
 (0)