English

Create the MelaSale. csv using Python Pandas containing data as shown in the table. Week 1 5000 5900 6500 3500 4000 5300 7900 Week 2 4000 3000 5000 5500 3000 4300 5900

Advertisements
Advertisements

Question

Create the MelaSale. csv using Python Pandas containing data as shown in the table.

Week 1 Week 2 Week 3
5000 4000 4000
5900 3000 5800
6500 5000 3500
3500 5500 2500
4000 3000 3000
5300 4300 5300
7900 5900 6000
Code Writing
Advertisements

Solution

import pandas as pd
data = 
{
    "Week 1": [5000, 5900, 6500, 3500, 4000, 5300, 7900],
    "Week 2": [4000, 3000, 5000, 5500, 3000, 4300, 5900],
    "Week 3": [4000, 5800, 3500, 2500, 3000, 5300, 6000]
}
df = pd.DataFrame(data)
df.to_csv("MelaSale.csv", index=False)
print("MelaSale.csv created successfully!")
shaalaa.com
  Is there an error in this question or solution?
Chapter 4: Plotting Data using Matplotlib - Intext Questions [Page 113]

APPEARS IN

NCERT Informatics Practices [English] Class 12
Chapter 4 Plotting Data using Matplotlib
Intext Questions | Q 2. | Page 113
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×