मराठी

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
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
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 4: Plotting Data using Matplotlib - Exercise [पृष्ठ १३५]

APPEARS IN

एनसीईआरटी Informatics Practices [English] Class 12
पाठ 4 Plotting Data using Matplotlib
Exercise | Q 12. | पृष्ठ १३५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×