You are on page 1of 3

import pandas as pd

import matplotlib.pyplot as plt


import colorama
from colorama import Fore
import numpy as np
print(Fore.RED + 'QUANTITATIVE')
print(Fore.BLUE+ 'ORDINAL')
print(Fore.YELLOW + 'CATEGORICAL')
flights=pd.read_csv("D:\\aryan\\Vit_temp\\flights_data.csv")
dictionary_state=flights.loc[:,
['Airline','Date_of_Journey','Duration_minutes','Price']]
x=['Airline','Date_of_Journey','Duration_minutes','Price']
y=[ i for i in range(20)]
z=[[i for i in dictionary_state.loc[j]]for j in y]

fig, ax=plt.subplots()
ax.set_axis_off()
rcol=plt.cm.BuPu(np.full(len(y),0.1))
ccolor=[["y","b","r","b"]for j in y]
plt.table(
cellText=z,
rowLabels=y,
colLabels=x,
colWidths=[0.2]*4,
cellColours=ccolor,
rowColours=rcol,
cellLoc="center",
loc="upper left")
plt.show()
Week 5 task Visual Idiom

Database: flight data set

Target user: Airline company

Requirement for visualization


1. To check the peak hours of the airlines and to hire pilots accordingly
2. To compare the flight durations with halts and stops and to improve them so that customers
rely on the airline and get comfort
3. To check the profits gained from flights based on peak hours

Task Abstraction

For all the above requirements, they can be mapped using queries

Dataset: table

Data type: Items, Attributes

Visual Idiom encoding techniques: the data can be arranged and expressed in graph for comparison

1. To check peak hours, the bar graph can be plot where the height represents the total flights at
the time and the x-axis represents the time slots
2. Other method could be scatter plots where the number of stops and flight durations are
mapped with different colors.

You might also like