├── README.md └── presentation.py /README.md: -------------------------------------------------------------------------------- 1 | # Simple-Soil-Analysis-in-Data-Science-using-Python 2 | This code was done using some packages which was the concepts of Data Science using Python. Packages such as Pandas, Numpy and Matplotlib - These packages was using in Data Science in Python. 3 | As this concept of code was Soil analysis using Data Science using Python. 4 | As we Taken some soils such as red soil, Black soil, Alluvial Soil, Laterite soil, Coastal Sandy soil in which crops are grown in these soil.Predicted crops grown in soil 5 | 6 | For Example: 7 | ![Screenshot 2024-08-19 215411](https://github.com/user-attachments/assets/477ed56b-fdfd-4b7d-b01d-dc3ecd6f8ff4) 8 | 9 | -------------------------------------------------------------------------------- /presentation.py: -------------------------------------------------------------------------------- 1 | #Soil Analysis Using DataScience 2 | import pandas as pd 3 | import numpy as np 4 | import matplotlib.pyplot as plt 5 | print("Welcome") 6 | print("\n") 7 | print("Different types of soil on normal Climatic Condition") 8 | print("\n") 9 | print("Types of Soil") 10 | print("\n") 11 | s=["Red Soil","Black soil","Alluvial soil","Laterite soil","Coastal Sandy soil"] 12 | soil=pd.Series(s,index=[1,2,3,4,5]) 13 | print(soil,end="") 14 | print("\n") 15 | 16 | print("Enter the type of soil in your area :") 17 | soiltype=int(input()) 18 | if(soiltype==1): 19 | print(''' 20 | Crops which grow in Red Soil: 21 | 1.Cotton 22 | 2.Wheat 23 | 3.Pulses:Gram,pigeon pea,and red gram 24 | 4.Jowar 25 | 5.Linseed 26 | 6.Millet 27 | 7.Potatoes 28 | ''') 29 | 30 | elif(soiltype==2): 31 | print(''' 32 | Crops which grow in Black Soil: 33 | 1.Cotton 34 | 2.Wheat 35 | 3.Groundnut 36 | 4.Sugarcane 37 | 5.Rice 38 | 6.Linseed 39 | 7.Sunflower 40 | ''') 41 | 42 | elif(soiltype==3): 43 | print(''' 44 | Crops which grow in Alluvial Soil: 45 | 1.Rice 46 | 2.Wheat 47 | 3.Pulses:Gram,pigeon pea,and red gram 48 | 4.Fruits 49 | 5.Jute 50 | 6.Oilseeds 51 | 7.Turmeric 52 | ''') 53 | 54 | elif(soiltype==4): 55 | print(''' 56 | Crops which grow in Laterite Soil: 57 | 1.Coffee 58 | 2.Tea 59 | 3.Rubber 60 | 4.Coconut 61 | 5.Pineapple 62 | 6.Cashew 63 | 7.Tobacco 64 | ''') 65 | 66 | elif(soiltype==5): 67 | print(''' 68 | Crops which grow in Coastal Sandy Soil: 69 | 1.Carrot 70 | 2.Beetroot 71 | 3.Cucumber 72 | 4.Muskmelon 73 | 5.Watermelon 74 | 6.Raddish 75 | 7.Cactus 76 | ''') 77 | else: 78 | print("No crops to grow") 79 | 80 | print("\n") 81 | 82 | print("Do you need further details of soil: yes/No") 83 | p=input() 84 | 85 | if(p=='yes'): 86 | if(soiltype==1): 87 | Soilcontent=["Moisture","Chemical composition","pH level"] 88 | percentage=[16.2,10.4,5.2] 89 | plt.pie(percentage,labels=Soilcontent,autopct="%5.2f%%") 90 | plt.title("Red soil content prediction") 91 | plt.show() 92 | 93 | elif(soiltype==2): 94 | Soilcontent=["Moisture","Chemical composition","pH level"] 95 | percentage=[19.6,8.4,5.6] 96 | plt.pie(percentage,labels=Soilcontent,autopct="%5.2f%%") 97 | plt.title("Black soil content prediction") 98 | plt.show() 99 | 100 | elif(soiltype==3): 101 | Soilcontent=["Moisture","Chemical composition","pH level"] 102 | percentage=[11.2,8.4,8.2] 103 | plt.pie(percentage,labels=Soilcontent,autopct="%5.2f%%") 104 | plt.title("Alluvial soil content prediction") 105 | plt.show() 106 | 107 | 108 | elif(soiltype==4): 109 | Soilcontent=["Moisture","Chemical composition","pH level"] 110 | percentage=[10.5,4.4,8.2] 111 | plt.pie(percentage,labels=Soilcontent,autopct="%5.2f%%") 112 | plt.title("Laterite soil content prediction") 113 | plt.show() 114 | 115 | elif(soiltype==5): 116 | Soilcontent=["Moisture","Chemical composition","pH level"] 117 | percentage=[16.2,11.1,2.2] 118 | plt.pie(percentage,labels=Soilcontent,autopct="%5.2f%%") 119 | plt.title("Coastal Sandy soil content prediction") 120 | plt.show() 121 | 122 | else: 123 | print("Sorry! There was no soil found") 124 | 125 | 126 | 127 | print("Thank you!!!") 128 | 129 | 130 | 131 | --------------------------------------------------------------------------------