Advertisements
Advertisements
प्रश्न
Collect and store data related to the screen time of students in your class separately for boys and girls and present it using a boxplot.
कोड लेखन
Advertisements
उत्तर
import pandas as pd
import matplotlib.pyplot as plt
data = {
'Boys': [3, 4, 5, 2, 6, 4, 5],
'Girls': [2, 3, 4, 5, 3, 6, 4]
}
df = pd.DataFrame(data)
print(df)
df.boxplot()
plt.title("Screen Time of Students")
plt.xlabel("Gender")
plt.ylabel("Screen Time (Hours)")
plt.show()
Output:
A box plot will be displayed comparing the screen time of boys and girls in the class. It shows the minimum value, maximum value, median, and spread of screen time data.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
