0% found this document useful (0 votes)
9 views16 pages

4026313 Discrete Coursework 45

The document outlines a consultancy report for an estate agency, detailing the use of Python and its libraries, particularly Pandas, to manage and analyze property data. It describes the processes of uploading, loading, processing, and manipulating a dataset containing property information, along with examples of client queries and property proposals. Additionally, it includes graphical representations of data insights using scatter, line, and bar charts to visualize property pricing and characteristics across different towns.

Uploaded by

Arpit Srivastava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views16 pages

4026313 Discrete Coursework 45

The document outlines a consultancy report for an estate agency, detailing the use of Python and its libraries, particularly Pandas, to manage and analyze property data. It describes the processes of uploading, loading, processing, and manipulating a dataset containing property information, along with examples of client queries and property proposals. Additionally, it includes graphical representations of data insights using scatter, line, and bar charts to visualize property pricing and characteristics across different towns.

Uploaded by

Arpit Srivastava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Discrete Mathematics

Student ID: 4026313

London South Bank University 1


4026313- Discrete Coursework

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

data.head() shows the result as follows:

For viewing the down rows, I am using data.tail() that shows result as follows:

1.2. Dataset Insights:


We can have quick insights on dataset that if we manually calculate could take most
of our time. Pandas help us to perform them within a second using data.desribe().
The result of this line of code is shown below, it has calculated total count, mean,
standard deviation, minimum, maximum, three percentiles and maximum from the
dataset.
CSI_4_DMA 4
4026313- Discrete Coursework

The columns I have renamed from the original dataset are shown below:
Name Updated Name

no of rooms Rooms

distance from the nearest town Distance

tax of property Taxperannum

no of pupils per teacher pupils

price of property Price

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:

I will search in my database using the query


data[(data.Rooms>=8)&(data.Distance <=6)& (data.Price>=20000)]

Now my client can select any property according to his need.

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()

data[(data.Rooms==Var1) & (data.Distance==Var2)]

It says that there is no such property that meets both conditions.

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.

Random User Requirement Handling System


I had to type all the queries to search a property against user requirements, but
as I am using Python and Pandas, it can be done more easily. The problem is
to develop a system in Python that will assist me in filtering out property records
more efficiently.
Solution:

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.

req1=int(input("Room requirment : "))

req2=float(input("Distance requirment : "))

req3=str(input("Area requirment : "))

req4=int(input("Price Range : "))

CSI_4_DMA 8
4026313- Discrete Coursework

It shows:

data[(data.Rooms>=req1)&(data.Distance<=req2)

&(data.Place==req3)&(data.Price==req4)]

Graphical Insights of Data:


Textual insights were time taking, graphical visuals help more quickly and efficiently,
So for my property I must use graphical contents like charts to make my work better.

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,tax,color='green',label="Tax Per Annum")


plt.title("Insights")
plt.ylabel("%")
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()

plt.plot(tv,tax,label="Tax per Annum")


plt.title("Insights")
plt.ylabel("tax rate")
plt.legend(loc=1)
plt.show()

plt.plot(tv,dist, color='red' ,label="Distance")


plt.title("Insights")
plt.ylabel("km")
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

You might also like