Coder Social home page Coder Social logo

kaggle-s-walmart-database-data-exploration-and-tableau-visualization's Introduction

Kaggle-s-Walmart-Database-Data-Exploration

Intro

Database link: https://www.kaggle.com/datasets/yasserh/walmart-dataset SQL code is an exploration of various factors related to sales in the Walmart dataset. Here's a breakdown of each section:

Overview

This repository contains an analysis of various factors related to sales in the Walmart dataset. The analysis is performed using Python for data exploration and visualization. Additionally, a Tableau visualization is included for a more comprehensive understanding of the dataset.

Section 1: Exploring Holidays

  • The query selects distinct dates and the holiday flag from the Walmart table where the holiday flag is set to 1 (indicating a holiday).
  • It retrieves the data for 10 holidays that have been found.

Section 2: Preparing Data for Visualization Purposes

  • The query calculates the average sales per week, average temperature per week, average fuel price per week, average CPI per week, and average unemployment per week.
  • It groups the data by date and orders it by date in ascending order.

Section 3: Exploring Sales on Normal Days vs. Holidays

  • The query calculates the average sales, average sales on holidays, and average sales on rest days for each date.
  • It groups the data by date and orders it by average sales in descending order.
  • The results show the impact of holidays on average total sales per week, with the highest average sales observed during preparations for Christmas and other holidays.

Section 4: Exploring the Relationship Between Average Temperature and Average Sales

  • The query calculates the average sales, average temperature in Celsius, and average temperature in Fahrenheit for each date.
  • It groups the data by date and holiday flag.
  • The results suggest that temperature may not play a crucial role in average sales per week.

Section 5: Exploring the Relationship Between Unemployment and Average Weekly Sales

  • The first query calculates the average sales and unemployment rate per store.
  • The second query calculates the overall unemployment variance.
  • The results indicate that unemployment does not play a crucial role in average sales per store.

Section 6: Exploring the Relationship Between Average Temperature, Average Sales, and Employment

  • The query calculates the average sales, average unemployment, average CPI, minimum average CPI, and maximum average CPI per date.
  • The results suggest that the CPI (Consumer Price Index) may have a significant effect on average sales.

Section 7: Exploring the Relationship Between Average Fuel Price and Average Sales

  • The query calculates the average sales, average fuel price, and average CPI per date.
  • The results suggest that fuel price may have a significant effect on average sales.

Each section explores different factors and their potential impact on average sales. The queries retrieve the necessary data, perform calculations, and present the results for further analysis and visualization purposes.

Python Code

We begin with the Python code to explore the Walmart dataset. The code performs the following tasks:

Data Loading

  • Loads the dataset from the 'Walmart.csv' file using the pandas library.

Data Exploration and Cleaning

  • Displays a snapshot of the dataset to provide an overview of the data structure.
  • Identifies and displays duplicate entries in the dataset.

Correlation Analysis

image

  • Calculates the correlation matrix for key variables, including 'Weekly_Sales,' 'Holiday_Flag,' 'Temperature,' 'Fuel_Price,' 'CPI,' and 'Unemployment.'
  • Exports the correlation matrix to 'corr.csv' for further reference.
  • Visualizes the correlation matrix using a heatmap with a grayscale color map.

Scatterplot Visualization

image

  • Selects specific columns for scatterplot visualization, excluding 'Date' and 'Store.'
  • Creates scatterplots to explore the relationships between 'Weekly_Sales' and other variables, with all data points represented in black.

Tableau Visualization

Overview The Tableau visualization provides a dynamic and interactive representation of the sales data. It offers insights into various aspects of sales trends and relationships between key factors. Correlation Common patterns

Data Analysis Insights

The analysis reveals interesting patterns, such as increased sales leading up to Christmas and Thanksgiving, followed by declines. Despite these declines, sales remain relatively high, possibly due to holiday preparations. The impact of factors like temperature, unemployment, fuel prices, and CPI on sales is explored, providing valuable insights for further analysis and decision-making.

Please refer to the code and Tableau visualization for more detailed insights into the Walmart sales dataset.

This README was written using GPT-3

kaggle-s-walmart-database-data-exploration-and-tableau-visualization's People

Contributors

ahmadmuhammadgd avatar

Watchers

 avatar

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.