Giter VIP home page Giter VIP logo

home_sales's Introduction

Home_Sales

UPenn Data Bootcamp Module 22 Assignment

  • Imported the necessary PySpark SQL functions for this assignment.
  • Read the home_sales_revised.csv data in the starter code into a Spark DataFrame.
  • Created a temporary table called homeSales.
  • Answered the following questions using SparkSQL:
    • What is the average price for a four-bedroom house sold for each year? Answer is rounded off to two decimal places.
    • What is the average price of a home for each year it was built that has three bedrooms and three bathrooms? Answer is rounded off to two decimal places.
    • What is the average price of a home for each year that has three bedrooms, three bathrooms, two floors, and is greater than or equal to 2,000 square feet? Answer is rounded off to two decimal places.
    • What is the "view" rating for homes costing more than or equal to $350,000? Determined the run time for this query, and rounded off answer to two decimal places.
  • Cached temporary table homeSales.
  • Verified if temporary table is cached.
  • Using the cached data, ran the query that filters out the view ratings with an average price of greater than or equal to $350,000. Determined the runtime and compare it to uncached runtime.
    • The uncached runtime was found to be 2.02 seconds. The cached runtime was found to be 0.86 seconds, making this significantly faster than the uncached runtime.
  • Partitioned by the "date_built" field on the formatted parquet home sales data.
  • Created a temporary table for the parquet data.
  • Ran the query that filters out the view ratings with an average price of greater than or equal to $350,000. Determined the runtime and compared it to uncached runtime.
    • The cached runtime was 0.86 seconds, where the partitioned runtime was found to be 0.98 seconds. While it is still over a second shorter than the unmodified query, it is slightly slower than the cached runtime by 0.12 seconds, making the cached data the most efficient.
  • Uncached the homeSales temporary table.
  • Verified that the homeSales temporary table is uncached using PySpark.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.