0% found this document useful (0 votes)
4 views1 page

Thomas Code Sample

The document demonstrates how to create a monthly sales dataset using pandas. It includes the sales data for six months and converts it into a DataFrame. Finally, it saves the DataFrame to a CSV file for use with AI chart tools.

Uploaded by

Stephen Karanja
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Thomas Code Sample

The document demonstrates how to create a monthly sales dataset using pandas. It includes the sales data for six months and converts it into a DataFrame. Finally, it saves the DataFrame to a CSV file for use with AI chart tools.

Uploaded by

Stephen Karanja
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import pandas as pd

# Example dataset: monthly sales

data = {

"Month": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],

"Sales": [1200, 1500, 1700, 1600, 1800, 2000]

# Convert to DataFrame

df = [Link](data)

# Save to CSV (ready for upload to AI chart tools)

df.to_csv("sales_data.csv", index=False)

print("Dataset prepared successfully ")

You might also like