text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_style('darkgrid')

ds = pd.read_csv('/kaggle/input/spotify-datacsv/spotify_data.csv', dtype={'19': float})
ds

ds.isna().sum()

ds.shape

ds.columns

len(ds.columns)

top_ten_genre = ds.groupby('artists').count().sort_values(by='name', ascending=False)['name'][:10]
top_ten_genre

top_ten_genre.plot.barh()

top_loudest_tracks = ds[['loudness', 'artists']].sort_values(by='loudness', ascending=False)[:5]
top_loudest_tracks

top_loudest_tracks.plot.barh()

top_dancable_songs = ds[['danceability', 'artists', 'name']].sort_values(by='danceability', ascending=False)[:5]
top_dancable_songs

top_instrumental_songs = ds[['instrumentalness', 'artists', 'name']].dropna(subset=['artists']).sort_values(by='instrumentalness', ascending=False)[:5]
top_instrumental_songs

plt.figure(figsize=(12, 7))
plt.pie(x='instrumentalness', autopct='%1.2f%%', data=top_instrumental_songs, labels=top_instrumental_songs.artists)
plt.title('Top 5 Instrumental Tracks by Genre')
plt.show()