-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathairline_data_python
More file actions
38 lines (29 loc) · 827 Bytes
/
airline_data_python
File metadata and controls
38 lines (29 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#Import libraries
import numpy as np
import pandas as pd
import pymysql as mysql
import matplotlib.pyplot as plt
import seaborn as sns
#connectting the sql
conn2=mysql.connect(host='localhost',
port=int(3306),
user='root',
passwd='******',
db='airline')
#Show tables
tableNames2 = pd.read_sql("""SHOW TABLES""", conn2)
tableNames2
#airline data as data frame
airline_table = """SELECT * FROM on_time_on_time_performance_2016_1 """
airline_df = pd.read_sql(airline_table, conn2)
airline_df.shape
airline_df.info()
airline_df.describe()
#Find the duplicates
airline_df.duplicated().sum()
#unique values
airline_df['UniqueCarrier'].unique()
#unique values
airline_df['UniqueCarrier'].unique()
### Find the Null values
airline_df.isnull().sum()