fork download
  1. import pandas as pd
  2. import seaborn as sns
  3. import matplotlib.pyplot as plt
  4.  
  5. # The JSON data provided
  6. data = [
  7. {"id": 22, "quote": "The Way To Get Started Is To Quit Talking And Begin Doing.", "author": "Walt Disney"},
  8. {"id": 27, "quote": "When I am silent, I have thunder hidden inside.", "author": "Rumi"},
  9. {"id": 65, "quote": "It's not bragging if you can back it up.", "author": "Muhammad Ali"},
  10. {"id": 79, "quote": "To fight against one's desires is the greatest of all fights.", "author": "Ali ibn Abi Talib (R.A)"},
  11. {"id": 82, "quote": "When I Started Counting My Blessings, My Whole Life Turned Around.", "author": "Willie Nelson"},
  12. {"id": 84, "quote": "All My Life I'Ve Looked At Words As Though I Were Seeing Them For The First Time.", "author": "Ernest Hemingway"},
  13. {"id": 99, "quote": "Money Is Only A Tool. It Will Take You Wherever You Wish, But It Will Not Replace You As The Driver.", "author": "Ayn Rand"},
  14. {"id": 128, "quote": "This Is The First Convention Of The Space Age - Where A Candidate Can Promise The Moon And Mean It.", "author": "David Brinkley"},
  15. {"id": 150, "quote": "Bad Men Are Full Of Repentance.", "author": "Aristotle"},
  16. {"id": 173, "quote": "Change Your Opinions, Keep To Your Principles; Change Your Leaves, Keep Intact Your Roots.", "author": "Victor Hugo"},
  17. {"id": 176, "quote": "A man who views the world the same at fifty as he did at twenty has wasted thirty years of his life.", "author": "Muhammad Ali"},
  18. {"id": 254, "quote": "Don't sit and wait. Get out there, feel life. Touch the sun, and immerse in the sea.", "author": "Rumi"},
  19. {"id": 290, "quote": "Your longing for ME is my message to you, All your attempts to reach ME, Are in reality MY attempts to reach you.", "author": "Rumi"},
  20. {"id": 335, "quote": "My impression of the American people can be summarized by a quotation from Benjamin Franklin, Those things that hurt instruct! I realized that people in this part of the world meet their problems head on. They attempt to get out of them rather than suffer them.", "author": "Abdul Kalam"},
  21. {"id": 372, "quote": "I know where I'm going and I know the truth, and I don't have to be what you want me to be. I'm free to be what I want.", "author": "Muhammad Ali"},
  22. {"id": 379, "quote": "Disneyland Will Never Be Completed. It Will Continue To Grow As Long As There Is Imagination Left In The World.", "author": "Walt Disney"},
  23. {"id": 398, "quote": "The Truth. It Is A Beautiful And Terrible Thing, And Must Therefore Be Treated With Great Caution.", "author": "J. K. Rowling"},
  24. {"id": 425, "quote": "The Only Way To Do News On Television Is Not To Be Terrified Of It.", "author": "David Brinkley"},
  25. {"id": 432, "quote": "Denial Ain'T Just A River In Egypt.", "author": "Mark Twain"},
  26. {"id": 453, "quote": "Where there is ruin, there is hope for a treasure.", "author": "Rumi"},
  27. {"id": 461, "quote": "To make one good action succeed another, is the perfection of goodness.", "author": "Ali ibn Abi Talib (R.A)"},
  28. {"id": 468, "quote": "The Will To Win, The Desire To Succeed, The Urge To Reach Your Full Potential... These Are The Keys That Will Unlock The Door To Personal Excellence.", "author": "Confucius"},
  29. {"id": 478, "quote": "Don't engage your heart in grief over the past or you wont be ready for what is coming.", "author": "Ali ibn Abi Talib (R.A)"},
  30. {"id": 480, "quote": "When a man says I cannot, he has made a suggestion to himself. He has weakened his power of accomplishing that which otherwise would have been accomplished.", "author": "Muhammad Ali"},
  31. {"id": 486, "quote": "Things Won Are Done, Joy'S Soul Lies In The Doing.", "author": "William Shakespeare"},
  32. {"id": 506, "quote": "He who trusts the world, the world betrays him.", "author": "Ali ibn Abi Talib (R.A)"},
  33. {"id": 535, "quote": "Dream is not that which you see while sleeping it is something that does not let you sleep.", "author": "Abdul Kalam"},
  34. {"id": 590, "quote": "A man may be as straight as an arrow, but even then he will have some critics.", "author": "Umar ibn Al-Khatt\u0101b (R.A)"},
  35. {"id": 593, "quote": "Others may know pleasure, but pleasure is not happiness. It has no more importance than a shadow following a man.", "author": "Muhammad Ali"},
  36. {"id": 605, "quote": "The vision of the eye is limited; the vision of the heart transcends all barriers of time and space.", "author": "Ali ibn Abi Talib (R.A)"},
  37. {"id": 665, "quote": "Know thyself, and thou shalt know God.", "author": "Ali ibn Abi Talib (R.A)"},
  38. {"id": 672, "quote": "If you expect the blessings of God, be kind to His people.", "author": "Abu Bakr (R.A)"},
  39. {"id": 676, "quote": "Do not use the sharpness of your speech on your mother who taught you how to speak.", "author": "Ali ibn Abi Talib (R.A)"},
  40. {"id": 693, "quote": "When the world pushes you to your knees, you're in the perfect position to pray.", "author": "Rumi"},
  41. {"id": 694, "quote": "Be Happy In The Moment, That'S Enough. Each Moment Is All We Need, Not More.", "author": "Mother Teresa"},
  42. {"id": 713, "quote": "We Must Believe That We Are Gifted For Something, And That This Thing, At Whatever Cost, Must Be Attained.", "author": "Marie Curie"},
  43. {"id": 751, "quote": "I want to sing like the birds sing, not worrying about who hears or what they think.", "author": "Rumi"},
  44. {"id": 769, "quote": "Even When Laws Have Been Written Down, They Ought Not Always To Remain Unaltered.", "author": "Aristotle"},
  45. {"id": 776, "quote": "Both Oligarch And Tyrant Mistrust The People, And Therefore Deprive Them Of Their Arms.", "author": "Aristotle"},
  46. {"id": 785, "quote": "Cursed Is The Man Who Dies, But The Evil Done By Him Survives.", "author": "Abu Bakr"},
  47. {"id": 794, "quote": "Do not be deceived by a man's eloquence; rather whoever fulfils trusts and refrains from impugning people's honour is a real man.", "author": "Umar ibn Al-Khatt\u0101b (R.A)"},
  48. {"id": 819, "quote": "Great dreams of great dreamers are always transcended.", "author": "Abdul Kalam"},
  49. {"id": 821, "quote": "Hide the good you do, and make known the good done to you.", "author": "Ali ibn Abi Talib (R.A)"},
  50. {"id": 856, "quote": "I know you're tired but come, this is the way.", "author": "Rumi"},
  51. {"id": 864, "quote": "Disneyland Is A Show.", "author": "Walt Disney"},
  52. {"id": 879, "quote": "In the silence of LOVE you will find the Spark of LIFE.", "author": "Rumi"},
  53. {"id": 880, "quote": "A Happy Marriage Is The Union Of Two Good Forgivers.", "author": "Ruth Graham"},
  54. {"id": 885, "quote": "I Don'T Want To Make Money, I Just Want To Be Wonderful.", "author": "Marilyn Monroe"},
  55. {"id": 894, "quote": "I Was Not Created To Be Occupied By Eating Delicious Foods Like Tied Up Cattle.", "author": "Ali Ibn Abi Talib"},
  56. {"id": 950, "quote": "I was saying “I'm the greatest” long before I believed it.", "author": "Muhammad Ali"}
  57. ]
  58.  
  59. # Convert the data to a pandas DataFrame
  60. df = pd.DataFrame(data)
  61.  
  62. # Plot the count of quotes by each author
  63. plt.figure(figsize=(12, 6))
  64. sns.countplot(data=df, x='author', order=df['author'].value_counts().index)
  65. plt.xticks(rotation=90)
  66. plt.title('Number of Quotes by Each Author')
  67. plt.show()
  68.  
Success #stdin #stdout 3.75s 119756KB
stdin
Standard input is empty
stdout
Standard output is empty