PlantDiseaseTreatmentAssistant / create_treatments_csv.py
iqramukhtiar's picture
Update create_treatments_csv.py
e9ddd76 verified
raw
history blame
6.78 kB
import pandas as pd
import os
def create_treatments_csv():
"""
Creates a CSV file with crop disease treatments information.
"""
# Define the data
data = {
'Crop': [
'Tomato', 'Tomato', 'Tomato', 'Tomato', 'Tomato', 'Tomato',
'Apple', 'Apple', 'Apple',
'Corn', 'Corn', 'Corn',
'Potato', 'Potato',
'Grape', 'Grape', 'Grape',
'Cherry',
'Peach',
'Strawberry'
],
'Disease': [
'Early Blight', 'Late Blight', 'Leaf Mold', 'Septoria Leaf Spot',
'Bacterial Spot', 'Yellow Leaf Curl Virus',
'Apple Scab', 'Black Rot', 'Cedar Apple Rust',
'Common Rust', 'Northern Leaf Blight', 'Cercospora Leaf Spot',
'Early Blight', 'Late Blight',
'Black Rot', 'Esca (Black Measles)', 'Leaf Blight',
'Powdery Mildew',
'Bacterial Spot',
'Leaf Scorch'
],
'Symptoms': [
'Brown spots with concentric rings on leaves, starting on older leaves',
'Dark water-soaked spots on leaves that quickly enlarge and turn brown with a slight yellow border',
'Pale yellow spots on upper leaf surfaces with olive-green to grayish-brown mold on undersides',
'Small circular spots with dark borders and light gray centers on leaves, starting on lower leaves',
'Small, raised, water-soaked spots on leaves, stems, and fruit that enlarge and turn brownish',
'Yellowing and curling of leaves, stunted growth, and reduced fruit production',
'Olive-green to brown spots on leaves and fruit, leaves may drop prematurely',
'Reddish-brown spots on leaves and fruit, infected fruit mummifies',
'Bright orange-yellow spots on leaves, orange gelatinous projections on fruit',
'Rust-colored pustules on both sides of leaves, severe infections cause leaf death',
'Long, cigar-shaped gray-green to tan lesions on leaves',
'Small, circular spots with tan centers and reddish-purple borders',
'Dark brown, concentric rings on lower leaves that spread upward',
'Water-soaked spots on leaves that rapidly enlarge and turn brown or black',
'Reddish-brown spots on leaves, dark lesions on fruit, fruit shrivels into black mummies',
'Red/brown streaks in wood, spots on leaves, and shriveled fruit',
'Small, irregular red spots on leaf surface that enlarge and become brown',
'White powdery coating on leaves, stems, and fruit',
'Small water-soaked spots on leaves and fruit that enlarge and turn purple with white centers',
'Purple to brown spots develop on the upper surface of older leaves, leaf edges appear scorched'
],
'Treatment': [
'Remove infected leaves, improve air circulation, rotate crops, avoid overhead watering',
'Remove infected plants, avoid overhead watering, use resistant varieties, apply fungicide preventatively',
'Improve air circulation, avoid overhead watering, remove infected leaves, rotate crops',
'Remove infected leaves, improve air circulation, mulch around plants, rotate crops',
'Remove infected plants, avoid working in wet fields, use copper-based sprays, rotate crops',
'Control whitefly vectors, remove infected plants, use reflective mulch, plant resistant varieties',
'Remove fallen leaves, prune for air circulation, plant resistant varieties, apply fungicide',
'Prune out infected branches, remove mummified fruit, apply fungicide, ensure good air circulation',
'Remove nearby cedar trees if possible, apply fungicide, plant resistant varieties',
'Remove infected leaves, apply fungicide early in season, plant resistant varieties',
'Rotate crops, remove crop debris, apply fungicide, plant resistant varieties',
'Rotate crops, remove infected debris, improve air circulation, apply fungicide',
'Remove infected leaves, improve air circulation, rotate crops, apply fungicide preventatively',
'Remove infected plants, avoid overhead watering, use resistant varieties, apply fungicide preventatively',
'Prune infected areas, remove mummified fruit, apply fungicide, ensure good air circulation',
'Prune infected areas, remove infected wood, ensure proper nutrition and water',
'Remove infected leaves, apply fungicide, ensure proper spacing between plants',
'Improve air circulation, apply fungicide at first sign, remove infected parts',
'Remove infected leaves and fruit, apply copper-based sprays, rotate crops',
'Ensure proper watering, add mulch, improve soil drainage, remove infected leaves'
],
'Medicine/Chemical Control': [
'Chlorothalonil, Mancozeb, Copper fungicides, Azoxystrobin',
'Chlorothalonil, Mancozeb, Copper-based fungicides, Cymoxanil',
'Chlorothalonil, Copper fungicides, Mancozeb, Potassium bicarbonate',
'Chlorothalonil, Copper fungicides, Mancozeb, Azoxystrobin',
'Copper hydroxide, Streptomycin sulfate (where allowed), Acibenzolar-S-methyl',
'No effective chemical control for the virus; focus on whitefly control with insecticides',
'Captan, Myclobutanil, Sulfur sprays, Thiophanate-methyl',
'Captan, Myclobutanil, Mancozeb, Thiophanate-methyl',
'Myclobutanil, Propiconazole, Mancozeb, Sulfur',
'Propiconazole, Azoxystrobin, Mancozeb, Pyraclostrobin',
'Azoxystrobin, Propiconazole, Pyraclostrobin, Mancozeb',
'Pyraclostrobin, Azoxystrobin, Chlorothalonil, Mancozeb',
'Chlorothalonil, Mancozeb, Azoxystrobin, Boscalid',
'Chlorothalonil, Mancozeb, Copper-based fungicides, Cymoxanil',
'Mancozeb, Myclobutanil, Captan, Tebuconazole',
'No highly effective chemical control; focus on cultural practices',
'Mancozeb, Copper fungicides, Captan, Fosetyl-aluminum',
'Sulfur, Potassium bicarbonate, Neem oil, Myclobutanil',
'Copper hydroxide, Oxytetracycline (where allowed), Streptomycin sulfate (where allowed)',
'Calcium nitrate sprays, Fungicides with Captan, Thiophanate-methyl'
]
}
# Create DataFrame
df = pd.DataFrame(data)
# Save to CSV
df.to_csv('crop_diseases_treatments.csv', index=False)
print("Created crop_diseases_treatments.csv with", len(df), "entries")
if __name__ == "__main__":
create_treatments_csv()