Page 266 - Robotics and AI class 10
P. 266

plt.show()

              # Find the most liked genre

              most_liked_genre = likes_by_genre.idxmax()
              print("The most liked genre is ",most_liked_genre)

              # Find the genre with the most followers
              most_followed_genre = followers_by_genre.idxmax()

              print("The genre with the most followers is ",most_followed_genre)
              Output:















































          14.  Regression Assignment (Predicting the Future) - Plot the relationship between the year and the average
              temperatures. Can you predict the average temperature for future years? What do you infer from the
              trend?
          Ans.  years = [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010] temperatures = [15.2, 15.5,
              15.7, 16.0, 16.2, 16.5, 16.8, 17.0, 17.2, 17.5, 17.8]

              Code will be

              import matplotlib.pyplot as plt
              # Given dataset



              264     Touchpad Robotics & Artificial Intelligence-X
   261   262   263   264   265   266   267   268   269   270   271