CoolFace
Apppublic

ShellyMimo/agrigrow

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
create_agric_data.py31 linesDownload Raw Back to root
1import csv
2import pandas as pd
3
4# Data for agricultural advice
5data = {
6    "advice_id": [1, 2, 3],
7    "advice_text": [
8        "Rotate crops to prevent soil depletion and improve yield.",
9        "Use organic compost to enrich soil nutrients and promote healthy plant growth.",
10        "Monitor weather conditions and adjust irrigation schedules accordingly."
11    ],
12    "steps": [
13        "1. Plan crop rotation to include legumes and cover crops.\n"
14        "2. Avoid planting the same crop family in the same spot year after year.",
15
16        "1. Prepare compost with a mix of green (nitrogen-rich) and brown (carbon-rich) materials.\n"
17        "2. Turn the compost regularly to aerate and accelerate decomposition.",
18
19        "1. Use soil moisture sensors or weather data to determine irrigation needs.\n"
20        "2. Adjust irrigation frequency and duration based on plant type and weather conditions."
21    ]
22}
23
24# Create a DataFrame
25df = pd.DataFrame(data)
26
27# Save the DataFrame to CSV
28df.to_csv('agriculture_data.csv', index=False, quoting=csv.QUOTE_MINIMAL)
29
30print("agriculture_data.csv file has been created successfully.")
31