AI Data Science Practical
AI Data Science Practical
import pandas as pd
pandas.core.frame.DataFrame
#To access first 5 rows of data from the Jaipur csv file
print(df.head())
#To access last 5 rows of data from the Jaipur csv file
df.tail()
date object
mean_temperature int64
max_temperature int64
min_temperature int64
Mean_dew_pt int64
mean_pressure float64
max_humidity int64
min_humidity int64
max_dew_pt_1 int64
max_dew_pt_2 int64
min_dew_pt_1 int64
min_dew_pt_2 int64
max_pressure_1 int64
max_pressure_2 int64
min_pressure_1 int64
min_pressure_2 int64
rainfall float64
dtype: object
# To Drop a column
df = df.drop(["max_dew_pt_2"], axis=1)
# To Drop a row at index 1
df = df.drop(1, axis=0)
# To Sort the values in descending order of date and print the first 5
rows
jaipur_weather = df.sort_values(by='date',ascending = False)
print(jaipur_weather.head())
# Scatter Plot
x = df.date
y = df.mean_temperature
plt.scatter(x,y)
plt.xticks(np.arange(0, 676, 60))
plt.xticks (rotation=90)
(array([ 0, 60, 120, 180, 240, 300, 360, 420, 480, 540, 600, 660]),
[Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, ''),
Text(0, 0, '')])