Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uploaded my submission and clean main repo #222

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

47 changes: 0 additions & 47 deletions solution.py

This file was deleted.

74 changes: 74 additions & 0 deletions submissions/ditorisan/spotify-challenge.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 46,
"id": "456dc579",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The total songs in the spotify csv file are: 953\n",
"There are 62 songs in Spotify CSV where key is E\n",
"The most common artist is Taylor Swift\n"
]
}
],
"source": [
"import pandas as pd\n",
"from collections import Counter\n",
"\n",
"# get the csv file\n",
"df = pd.read_csv(\"spotify-2023.csv\", encoding=\"ISO-8859-1\")\n",
"\n",
"# Challenge 1\n",
"songs = df[\"track_name\"]\n",
"print(f\"The total songs in the spotify csv file are: {len(songs)}\")\n",
"\n",
"# Challenge 2\n",
"songs_key_E = df[df[\"key\"] == \"E\"]\n",
"print(f\"There are {len(songs_key_E)} songs in Spotify CSV where key is E\")\n",
"\n",
"# Challenge 3\n",
"\n",
"artists_name = df[\"artist(s)_name\"]\n",
"artist_list = artists_name.tolist()\n",
"artist_counts = Counter(artist_list)\n",
"most_common_artist = artist_counts.most_common(1)\n",
"print(f\"The most common artist is {most_common_artist[0][0]}\")\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9c0aa15e",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}