- Added all 89 albums that were genuinely dropped from 2020 to 2023 - Fixed incorrect status markings (many albums marked "New in 2023" were not new) - Removed duplicates and albums incorrectly marked as dropped - Final count: 589 total (500 main list + 89 dropped) - Updated JavaScript validation for extended range - Created comprehensive analysis scripts to verify data Math now adds up correctly: 89 albums dropped to make room for new additions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
105 lines
No EOL
3.7 KiB
Python
105 lines
No EOL
3.7 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Add the remaining dropped albums to complete the list of 89 total dropped albums.
|
|
We already have 7, so we need to add 82 more.
|
|
"""
|
|
|
|
import csv
|
|
|
|
# Albums already in our dropped list (501-507)
|
|
already_added = {
|
|
("The Rolling Stones", "Exile on Main Street"),
|
|
("David Bowie", "The Rise and Fall of Ziggy Stardust and the Spiders From Mars"),
|
|
("Prince", "Sign O' the Times"),
|
|
("Eric B. and Rakim", "Paid in Full"),
|
|
("Metallica", "Metallica (Black Album)"),
|
|
("Weezer", "Weezer (Blue Album)"),
|
|
("Sonic Youth", "Goo")
|
|
}
|
|
|
|
def main():
|
|
# Read the complete dropped albums list
|
|
all_dropped = []
|
|
with open('truly_dropped_albums.csv', 'r', encoding='utf-8') as file:
|
|
reader = csv.DictReader(file)
|
|
for row in reader:
|
|
all_dropped.append({
|
|
'rank_2020': row['Original_Rank_2020'],
|
|
'artist': row['Artist'],
|
|
'album': row['Album']
|
|
})
|
|
|
|
print(f"📊 Total dropped albums from 2020→2023: {len(all_dropped)}")
|
|
|
|
# Filter out the ones we've already added
|
|
to_add = []
|
|
for album in all_dropped:
|
|
key = (album['artist'], album['album'])
|
|
# Check variations
|
|
if key not in already_added:
|
|
# Also check without parentheses for Black Album
|
|
alt_album = album['album'].replace(' (The Black Album)', '').replace(' (Blue Album)', '')
|
|
alt_key = (album['artist'], alt_album)
|
|
if alt_key not in already_added:
|
|
to_add.append(album)
|
|
|
|
print(f"📊 Already added as dropped: {len(already_added)}")
|
|
print(f"📊 Need to add: {len(to_add)}")
|
|
|
|
# Read current CSV
|
|
albums = []
|
|
with open('top_500_albums_2023.csv', 'r', encoding='utf-8') as file:
|
|
reader = csv.DictReader(file)
|
|
for row in reader:
|
|
albums.append(row)
|
|
|
|
current_max_rank = max(int(album['Rank']) for album in albums)
|
|
next_rank = current_max_rank + 1
|
|
|
|
# Get info/descriptions from 2020 data
|
|
info_desc_2020 = {}
|
|
with open('rolling_stone_top_500_albums_2020.csv', 'r', encoding='utf-8') as file:
|
|
reader = csv.DictReader(file)
|
|
for row in reader:
|
|
key = (row['Artist'], row['Album'])
|
|
info_desc_2020[key] = {
|
|
'info': row.get('Info', ''),
|
|
'description': row.get('Description', '')
|
|
}
|
|
|
|
# Add remaining dropped albums
|
|
added_count = 0
|
|
for album in to_add:
|
|
key = (album['artist'], album['album'])
|
|
info_data = info_desc_2020.get(key, {'info': '', 'description': ''})
|
|
|
|
albums.append({
|
|
'Rank': str(next_rank),
|
|
'Artist': album['artist'],
|
|
'Album': album['album'],
|
|
'Status': f"Dropped (was #{album['rank_2020']} in 2020)",
|
|
'Info': info_data['info'],
|
|
'Description': info_data['description']
|
|
})
|
|
next_rank += 1
|
|
added_count += 1
|
|
|
|
if added_count <= 10:
|
|
print(f"✓ Added: #{album['rank_2020']} - {album['artist']} - {album['album']}")
|
|
|
|
if added_count > 10:
|
|
print(f"... and {added_count - 10} more")
|
|
|
|
# Write updated CSV
|
|
with open('top_500_albums_2023.csv', 'w', newline='', encoding='utf-8') as file:
|
|
fieldnames = ['Rank', 'Artist', 'Album', 'Status', 'Info', 'Description']
|
|
writer = csv.DictWriter(file, fieldnames=fieldnames)
|
|
writer.writeheader()
|
|
writer.writerows(albums)
|
|
|
|
print(f"\n✅ Added {added_count} dropped albums")
|
|
print(f"📊 Total albums now: {len(albums)}")
|
|
print(f"📊 Total dropped albums: {len([a for a in albums if 'Dropped' in a['Status']])}")
|
|
|
|
if __name__ == "__main__":
|
|
main() |