Skip to content

Commit 6508891

Browse files
Update twitter-api.ipynb
Now it is top 10 and not top 10K
1 parent c99fe5d commit 6508891

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

days/58-60-twitter-api/twitter-api.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,7 @@
15211521
],
15221522
"source": [
15231523
"excl_rts = [tweet for tweet in tweets if not tweet.text.startswith('RT')]\n",
1524-
"top_10 = sorted(excl_rts, key=lambda tw: (tw.likes + tw.rts)/2, reverse=True)\n",
1524+
"top_10 = sorted(excl_rts, key=lambda tw: (tw.likes + tw.rts)/2, reverse=True)[:10]\n",
15251525
"\n",
15261526
"fmt = '{likes:<5} | {rts: <5} | {text}'\n",
15271527
"print(fmt.format(likes='❤', rts='♺', text='✎'))\n",

0 commit comments

Comments
 (0)