4026313 Discrete Coursework 45
4026313 Discrete Coursework 45
Coursework Aim:
Imagine that you have been employed as an independent consultant by a newly formed
estate agency to investigate property pricing within three different towns/villages in the local
area.
Consultancy Report
I will take myself as a property dealer and I have a database of properties and I will manage
my record using Python & its libraries.
1. Uploading Process:
To start processing I will upload my dataset first:
After uploading, Click on the New button and the Upload button then Click on Python
Workbook. Now the task is to load, manipulate, process, visually represent dataset.
CSI_4_DMA 2
4026313- Discrete Coursework
2. Loading Process:
As we are exploring the dataset stored in .csv file format that must be processed by
using Python on Jupyter Notebook. We can use a Python library that can easier our
work i.e. Pandas.
To use Pandas in our Notebook we need to import it first using import and as
keyword.
Import pandas as pd
Once we are done with importing of the dataset we have to load it into a variable
through which we can access it, anywhere in the notebook. I am using dataset as
database variable, throughout the assignment.
dataset=pd.read(“4026313.csv”, delimiter=”,”)
CSI_4_DMA 3
4026313- Discrete Coursework
Now the data set has been loaded successfully and to perform any operation on it
we can access it by using the data variable we used for dataset loading.
1.1. Data Processing:
The dataset has been loaded in the data variable contains only data, conveys no
meaning, to make it meaningful we need to process it to convert it into information.
Lets have its analytics, so that we can perform certain operations on it. Viewing some
topmost rows using
For viewing the down rows, I am using data.tail() that shows result as follows:
The columns I have renamed from the original dataset are shown below:
Name Updated Name
no of rooms Rooms
TOWN/VILLAGE Place
3. Data Manipulation:
Data is accessed first then it is processed after that the process of data manipulation
begins. Data manipulation refers to the operations that are performed on data to make
it information. There are different ways of manipulation of different type of data, we
are considering it as problem and solution method.
CSI_4_DMA 5
4026313- Discrete Coursework
Client 1:
A client comes with the following requirements:
8 rooms
6 km away
Price range 30,000
As a property dealer I must abide by the rules and I am ought to find a solution
where all the three requirements fulfil.
Property Proposal:
Client 2
Client comes he has a family and animals. He wants a wide house far away
from the town at any cost in any village.
Property Proposal:
Being a property dealer, I will assist the client by finding a suitable property that
must abide by the client needs. I have to search such a property in my record,
but what if the record is too long to search for? I can perform quick search
operation by using simple query
CSI_4_DMA 6
4026313- Discrete Coursework
Var1=(data.Rooms).max()
Var2=(data.Distance).max()
Client 3
A customer comes who wants a plot/house/property in Bedford under 40,000
pounds. The only requirement is this, he does not want it to be so far and he is
least interest in the age of property.
Property Proposal:
So being a property dealer I have to offer them with the property they want if it
is available or not; for this purpose I will use a simple query to search if there is
a house I Bedford in range below than 40 thousand Pounds. This task can
be done by a simple query written below:
data[(data.Place=='Bedford') &(data.Price<=40000)]
CSI_4_DMA 7
4026313- Discrete Coursework
The result is shown below in the code snippet that a variety of such kinds of
houses is available in the Bedford having cost less than 40 thousand pounds.
To check if any such house exists I will take some help from pandas and use
this line of code for data manipulation as required.
CSI_4_DMA 8
4026313- Discrete Coursework
It shows:
data[(data.Rooms>=req1)&(data.Distance<=req2)
&(data.Place==req3)&(data.Price==req4)]
Scatter Chart:
Scatter chart shown the distribution of data along x-axis and y-axis by plotting each single
point against x-y axis. This gives a view of scattered points that is called a scatter chart
collectively.
Description:
In the scatter charts shown below, it is shown clearly that the Price in Town/ Village
named as Belmont is the highest implies that the most expensive property is located
is than Bedford and the low cost properties are located in Arlington.
CSI_4_DMA 9
4026313- Discrete Coursework
Code Snippet:
price=data["Rooms"]
dist=data["Distance"]
tax=data["Taxperannum"]
tv=data["Place"]
plt.scatter(tv,price,color='green',label="Price Ranges")
plt.title("Insights")
plt.ylabel("Prices")
plt.show()
plt.scatter(tv,dist,color='green',label="Distance")
plt.title("Insights")
plt.ylabel("km")
plt.show()
CSI_4_DMA 10
4026313- Discrete Coursework
CSI_4_DMA 11
4026313- Discrete Coursework
Line Chart:
Line chart represents data by plotting different lines. Here is the code snippet and the output of
line charts of my dataset.
price=data["Rooms"]
dist=data["Distance"]
tax=data["Price"]
tv=data["Place"]
plt.plot(tv,price,color='green', label="Pricing")
plt.title("Insights")
plt.ylabel("Prices")
plt.legend(loc=1)
plt.show()
CSI_4_DMA 12
4026313- Discrete Coursework
Description:
In the line charts shown above, it is shown clearly that the Price in Town/
Village named as Belmont is the highest implies that the most expensive
property is located is Belmont than Belmont and the low cost properties are
located in Arlington.
CSI_4_DMA 13
4026313- Discrete Coursework
Bar Chart:
Bar chart with different characteristics is shown below with the code snippets.
price=data["Rooms"]
dist=data["Distance"]
tax=data["Taxperannum"]
tv=data["Place"]
plt.bar(tv,price, color='green')
plt.title("Pricing")
plt.ylabel("Prices")
plt.xticks(tv)
plt.show()
plt.bar(tv,tax,color='red')
plt.title("Taxation")
plt.ylabel("rate in %")
plt.xticks(tv)
plt.show()
plt.bar(tv,dist,)
plt.title("Distance")
plt.ylabel("km")
plt.xticks(tv)
plt.show()
CSI_4_DMA 14
4026313- Discrete Coursework
Description:
In the bar charts shown above, it is shown clearly that the Price in Town/ Village named
as Belmont is the highest implies that the most expensive property is located is Belmont
than in Bedford and the low cost properties are located in Arlington.
CSI_4_DMA 15
4026313- Discrete Coursework
Summary
CSI_4_DMA 16