| import pandas as pd
|
|
|
|
|
|
|
| def load_hackathons(csv_file):
|
| df = pd.read_csv(csv_file)
|
| hackathons = []
|
|
|
| for _, row in df.iterrows():
|
| skills = row["Required Skills"].split(",")
|
| skills = [skill.strip().title() for skill in skills]
|
| hackathons.append({"name": row["Hackathon Name"], "skills": skills})
|
|
|
| return hackathons
|
|
|
|
|
|
|
| def recommend_hackathons(user_skills, hackathons):
|
| recommendations = []
|
| for hackathon in hackathons:
|
| matched_skills = [skill for skill in user_skills if skill in hackathon["skills"]]
|
| if matched_skills:
|
| recommendations.append((hackathon["name"], len(matched_skills)))
|
|
|
|
|
| recommendations.sort(key=lambda x: x[1], reverse=True)
|
|
|
| return [rec[0] for rec in recommendations]
|
|
|
|
|
|
|
| csv_path = r"C:\Users\safal\PycharmProjects\PythonProject\Hackathon_Dataset.csv"
|
| hackathons = load_hackathons(csv_path)
|
|
|
|
|
| user_skills = input("Enter your skills (comma-separated): ").split(",")
|
|
|
|
|
| user_skills = [skill.strip().title() for skill in user_skills]
|
|
|
|
|
| recommended_hackathons = recommend_hackathons(user_skills, hackathons)
|
|
|
|
|
| print("\nYour Skills:", user_skills)
|
| print("Recommended Hackathons:", recommended_hackathons if recommended_hackathons else "No matching hackathons found.")
|
|
|