Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
69 views
7 pages
Class 10 Ai Practical
Uploaded by
anshul.vijay.c
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save class 10 ai practical For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
69 views
7 pages
Class 10 Ai Practical
Uploaded by
anshul.vijay.c
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save class 10 ai practical For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 7
Search
Fullscreen
ie a): te 2}: In (3: ‘out [3]: In [4]: outa): import pandas import pandas ‘read the csv file pd dfzpd.read_csv("JaipurFinalCleandata.csy-2023112771325507-001.21p") type (df) pandas. core. Frane.DataFrane exploring the data oF ate_mean.temperatre_max.temperatre min temperature Mean dew_pt_iean_pressure maxhumily min_pumidty maxdew.plt_maxdew p12 ie 05 806 ane. sor ame 505 aor ame. tie ze. 2010. on 676 rows « 17 columns I ‘to access first 5 rows of data from the Jaipur csv file 4 ” » Py “ e a Py 2 Sto access Last 5 rows of data from the Jaipur csv file date mean temperature max tenperature in a ean sew pt mean pressure max husidity min huaidity In 71 print afshead()) print af.tail()) ‘Ho Find out the type of dato of -atypes © 2015-05-04 * 2 2016-05-06 cn 3 2016-05-07 » 5 2016-05-08 M 3 B 1000.39, 5 ® 1006.73 rin_dou pti min.deu pt.2 ° 4 2 2 6 0 3 5 6 4 6 8 5 5 6 win pressure 2 rainfall ‘ 1008 date mean tenperature max tenperature min tewperature \ 672 2018-03-08 ean dew pt ean pressure on oa ioie.o? toia.t6 @ 2 mmox_pressure_t Py 1009) ro wi 1010 1010 we 7 6 snax_pressure 2 2 1008 1008 won 1 1010 ‘in_pressure_t 6 sex humidity ain punidity mas_den ptt ss ” 3000 1003 008 1002 3002 \ 100600 | 1005 05 100039 sores 101970 a » 8 a 5 10 2 6min_dew_pt_1 min dew pt_2 max_pressure_1 max_pressure_2 \ en 3 ° 1018 1017 672 “6 3 1017 aig 673 x “6 1017 1017 674 a “5 1017 1e7 675 e a 1017 1017 win_pressure_1 min pressure 2 rainfall on 182 1012 0.0 672 ro 1012 0.0 673 ae 1011 eo 674 11009 ao eo 675 1009 1009 e.0 out[7]: date object mean_temperature int6@ max_fenperature Antes ‘min_temperature intea Hean_dew pt intea mean_pressure floatea max humidity intea min_hunidity intea max_dew_pt_1 intea min_dew_pt_1 intea min_dew_pt_2 intea max pressure 1 intea max_pressure_2 intea min_pressure_1 intea min_pressure 2 intea rainfall floatea type: object Im [6]: Ato drop 0 column fs dfvdrop( {max dew pt.2"], axis= 1) to sore the values in descending order of date and print the first 5 rows Jaipur_weather= aF.sort values(by= "date", ascending- False) print (Jatpur-weather-ead()) Fto sort the values in ascending order of mean tenperature and print the first 5 rows jaipur westhers df. sort_values(bys “moan texperatore’, ascending True) print Jatpur_weather-head()) date mean_tenperature max_tomperature min temperature \ 7s. 2018-03-11 26 u Pn 574 2018-03-10 2% a4 9 673 2018-03-08 26 B 1 672 2018-03-08 2 2 as 67. 2018-03-07 24 3 Fr ean_dew pt mean_pressure max humidity min_husidity maxdew pti \ os 4 1013.76 8 a 2 os a ao1e.at 2 e 5 on 2 1016.07 5s 5 a Imin dew pt 1 min dew pt 2 max pressure 1 max pressure 2 \ os ° 4 1017 1017 era a “s 1017 1017 on 5 ea 1017 1017 on 6 3 1017 1018 om 3 ° 1018 1017 mmin_pressure_1 min_pressure 2 rainfall 675 1009 11009 0.0 674 11009 1011 0 673 1011 aon 0.0 on 1011 1012 0.0 67 1012 1011 0.0 date mean_temperature max_temperature min_temperature \ 282 2017-01-11, 10 18 3 283 2017-01-12 2 19 4 258 2017-01-17 DR 20 5 285 2017-01-14 2 20 5 254 2017-01-13, 2 20 4252 253 258 255 254 252 253 258 255 24 252 253 258 255 254 rm (8) In [10]: Mean_dew pt mean_pressure max humidity min_humidity max dew pt_1 \ 3 1017.00 34 v7 9 3 1017.54 70 B 2 3 1017.35 4 15 7 a 1017.75 70 10 1 5 1017.24 5 4 2 min_dew pt1 mindewpt_2 max_pressure 1 max pressure 2 \ *5 4 1019 1018 7 i 1020 1019 2 ° 1019 1021 “8 3 1020 1020 “3 7 1020 1020 wmin_pressure_1 min_pressure 2 rainfall 2015 1018 0.0 2015 1015 oo 2015 1015 oo 1016 1015 0.0 101s 1015 0.0 ‘using matplotlib to start plotting sone graphs Anport natplotlib.pyplot ae plt import numpy a= np scatter plot Fedate y= éf.mean_temperature plt-scatter(x,y) pltxticks(ap-arange(0,676,.0)) plt.xticks(rotation= 90) add x and y labels and set a font size plt-xlabel("Date", fontsize= 14) plt.ylabel(*Hean temperature", fontsize= 14) plt.title("Hean temperature at Jaipur", fontsiz pt. show) Mean temperature at Jaipur Mean temperature se 3 a 20 2016-05-04 2016-07-04 2016-09-02 2016-11-01 2016-12-31 2017-03-01 #§ 2017-04-30 2017-06-29 2017-08-28 2017-10-28 2017-12-27 2018-02-25 2In [11]: #Line plots plt.figure(Figsize= (20,10)) x= df.date Yt df.max temperature yids df min temperature y_3= df .mean_teaperature my hy? plt.plot(x, y_1, labels “Hox temp") plt.plot(x, y_2, labels “Hin temp") plt.plot(x, y3, labels “Hean temp") plt-plot(x, 2) label= “Range") plt.xticks(np-arange(®, 676, 60)) plt.xticks(rotation= 30) plt.legend() plt-shou(), In [13]: #histogram y= df.mean_temperature plt.hist(y, bins= 10) plt.xlabel('No. of days*) plt.ylabel(“Tenperature’ ) plt.title("Probability Distribution of temperature over 2 years(2016-2018) in Jaipur’) plt.show(),Probability Distribution of temperature over 2 years(2016-2018) in Jaipur 140 120 100 80 Temperature 60 40 20 20 25 No. of days In [14]: import opency from matplotlib import v2 import motplotlib inport matplotlib.pyplot as plt import numpy import numpy as np In [15]: #load the image fite into menory ing: cv2. imread('Flower. jpg") plt.imshow(cv2.cvtColor(img, cv2.COLOR_8GR2RGB)) plt-title(‘flower image’) plt-axis("on") plt.show() print ing. shape) flower image 1000 2000-3000 (5658, 3770, 3)In 07] (18) #display image as @ grayscale image mg v2. inread(* Flower. jpg", 0) ‘the number @ opens the image as a gray: pIt.imshow(img, cmap= “gray") ple.title( Grayscale tage") plt.axis("on') plt.show() print ing. shape) Grayscale Image 1000 2000 +3000 (5655, 3770) seropping im ing= cv2.Amread( Flower jpg") ‘load the image File into menory pl&. imshow(ev2.cvtColor(img, cv2.COLOR_8GR2RGB)) ois img{2000:3100, 14002650] fingfrange of y, range of x] plt-imshow(ev2.evtColor(roi, ev2-COLOR_8GR2RGB)) plt.title( ‘Cropped Inage") plt.axis(‘off") plt.show() Cropped ImageIn [20]: #copy ‘flower img v2.imread(’ flower jpg) Flower= img[2000:2100, 1400:2650)] ing[0:1100, 0:1250]= ing[0:1100, 2500:3750]= img[4555:5800, 0:1250 plt.title( ‘copied Flowers") plt-imshou(cv2.cvtColer(ing, cv2.COLOR_BGR2RGS)) plt.axis(’on") plt.show() n multiple places mg[4555:5800, 2500:3750]= flower 8, 6, RJ= ime print("Red-", L Located at x=500, y-500 1G) "Blue", 8) ev2.imerite("CopiedFlowers. pe", img) In (27): resizing images, maintaining aspect rati ing= cv2.imread( "Flower. jee") print (ing. shape) resizeds cv?. resize ing, (int (ing-shape[1]/4), int(ine.shape[0]/4))) pit. imshow(ev2.cvtcoLor(ing, cv2-COLOR_8GR2RGE)) plt.title( Resized Image’) pltiaxis("oFF") plt.shon() print (resized. shape) Copied Flowers Resized Image 1000 2000 ©3000 (1413, 942, 3)
You might also like
AQI Project
PDF
No ratings yet
AQI Project
25 pages
Weather Data Recorder Project
PDF
No ratings yet
Weather Data Recorder Project
3 pages
Python Data Cleaning
PDF
100% (1)
Python Data Cleaning
20 pages
Practical-Data Science: Delhi Public School Bangalore - East Artificial Intelligence Advance Python
PDF
No ratings yet
Practical-Data Science: Delhi Public School Bangalore - East Artificial Intelligence Advance Python
4 pages
Data Science Journal
PDF
No ratings yet
Data Science Journal
3 pages
Web Scraping Weather Data Using Python - by Abhishek Khatri - Medium
PDF
No ratings yet
Web Scraping Weather Data Using Python - by Abhishek Khatri - Medium
8 pages
DSBDA GRP A Print
PDF
No ratings yet
DSBDA GRP A Print
65 pages
Months
PDF
No ratings yet
Months
63 pages
Months Changed
PDF
No ratings yet
Months Changed
60 pages
DS Task-2
PDF
No ratings yet
DS Task-2
6 pages
Weather Data Time Series Modelling Delhi-Kaggle Notebook - by Merve Gamze C. - Medium
PDF
No ratings yet
Weather Data Time Series Modelling Delhi-Kaggle Notebook - by Merve Gamze C. - Medium
18 pages
CSV File
PDF
No ratings yet
CSV File
28 pages
Practical-Data Science: Delhi Public School Bangalore - East Artificial Intelligence
PDF
No ratings yet
Practical-Data Science: Delhi Public School Bangalore - East Artificial Intelligence
5 pages
Average Changed
PDF
No ratings yet
Average Changed
7 pages
RainFall - Prediction - Ipynb - Colaboratory
PDF
No ratings yet
RainFall - Prediction - Ipynb - Colaboratory
7 pages
LAB4TASK2.ipynb - Colaboratory
PDF
No ratings yet
LAB4TASK2.ipynb - Colaboratory
5 pages
MLT Use Case
PDF
No ratings yet
MLT Use Case
13 pages
C ML2
PDF
No ratings yet
C ML2
6 pages
Hanoi 2019 Và 2020-Descriptive Statistics
PDF
No ratings yet
Hanoi 2019 Và 2020-Descriptive Statistics
7 pages
Assignment-Deep Learning
PDF
No ratings yet
Assignment-Deep Learning
8 pages
Panda 2
PDF
No ratings yet
Panda 2
2 pages
Aqi 13591
PDF
No ratings yet
Aqi 13591
3 pages
MLRecord
PDF
No ratings yet
MLRecord
24 pages
Weather Report
PDF
No ratings yet
Weather Report
7 pages
DMV - 4 - Jupyter Notebook
PDF
No ratings yet
DMV - 4 - Jupyter Notebook
8 pages
Untitled 5
PDF
No ratings yet
Untitled 5
10 pages
195-Student - Jupyter Notebook
PDF
No ratings yet
195-Student - Jupyter Notebook
9 pages
What Is Pandas-Python? Introduction and Installation
PDF
No ratings yet
What Is Pandas-Python? Introduction and Installation
2 pages
Read and Write CSV and XLS Files
PDF
No ratings yet
Read and Write CSV and XLS Files
7 pages
Latihan Python
PDF
No ratings yet
Latihan Python
15 pages
7.2 - Data Frame Basics - mp4
PDF
No ratings yet
7.2 - Data Frame Basics - mp4
3 pages
DSBDA1 - Jupyter Notebook
PDF
No ratings yet
DSBDA1 - Jupyter Notebook
11 pages
Explainable Ai Driven Rainfall Prediction Using DL
PDF
No ratings yet
Explainable Ai Driven Rainfall Prediction Using DL
66 pages
Exemplar - Explore Confidence Intervals
PDF
No ratings yet
Exemplar - Explore Confidence Intervals
11 pages
HCM Temp 2019 Và 2020-Descriptive Statistics
PDF
No ratings yet
HCM Temp 2019 Và 2020-Descriptive Statistics
6 pages
Pandas Group by PDF
PDF
No ratings yet
Pandas Group by PDF
7 pages
Introduction To Matplotlib
PDF
No ratings yet
Introduction To Matplotlib
58 pages
Project Anish
PDF
No ratings yet
Project Anish
27 pages
CSE315:Introduction To Data Science: WEEK-8
PDF
No ratings yet
CSE315:Introduction To Data Science: WEEK-8
27 pages
Explore Weather Trends
PDF
No ratings yet
Explore Weather Trends
6 pages
Performing Analysis of Meteorological Data: Punam Seal
PDF
No ratings yet
Performing Analysis of Meteorological Data: Punam Seal
21 pages
AOD Lab1 2
PDF
No ratings yet
AOD Lab1 2
6 pages
Code Python
PDF
No ratings yet
Code Python
2 pages
Pandas - Workshop - Jupyter Notebook
PDF
No ratings yet
Pandas - Workshop - Jupyter Notebook
5 pages
DSBDA1 Ara
PDF
No ratings yet
DSBDA1 Ara
11 pages
Exemplar - Dataframes With Pandas
PDF
No ratings yet
Exemplar - Dataframes With Pandas
11 pages
Assignment 2
PDF
No ratings yet
Assignment 2
6 pages
ML Assignment 3
PDF
No ratings yet
ML Assignment 3
6 pages
1d-9950-68cf14f647fb - FIRE DETECTIOhihjhvN
PDF
No ratings yet
1d-9950-68cf14f647fb - FIRE DETECTIOhihjhvN
19 pages
Practical 2.ipynb - Colaboratory
PDF
No ratings yet
Practical 2.ipynb - Colaboratory
2 pages
Experiment - 1 csd201
PDF
No ratings yet
Experiment - 1 csd201
19 pages
Rainfall - Prediction - Ipynb - Colaboratory
PDF
No ratings yet
Rainfall - Prediction - Ipynb - Colaboratory
10 pages
Recurrent Neural Network-Programs
PDF
No ratings yet
Recurrent Neural Network-Programs
9 pages
PJT Explanation of Code Line by Line
PDF
No ratings yet
PJT Explanation of Code Line by Line
2 pages
Dma 89
PDF
No ratings yet
Dma 89
21 pages
Tcs EDA Question
PDF
0% (1)
Tcs EDA Question
5 pages
HW4 Weather
PDF
No ratings yet
HW4 Weather
6 pages
Yash Week 3 Uber Case Study
PDF
No ratings yet
Yash Week 3 Uber Case Study
38 pages
Getting Your Hands-On Climate Data - Visualize Climate Data With Python
PDF
No ratings yet
Getting Your Hands-On Climate Data - Visualize Climate Data With Python
20 pages