A python based prescriptive analysis of the Instacart database for the Career Foundry Data Analysis course using Jupyter Notebook.
Instacart, an online grocery store that operates through an app is considering a targeted marketing strategy. The stakeholders want to know more information about their sales patterns, especially the variety of customers in their database along with their purchasing behaviours.
They have requested an initial exploratory analysis of some of their data in order to derive insights and suggest strategies for better segmentation based on the provided criteria.
To address this objective and the key questions below the Instacart data sets were imported into Jupiter Notebook and analysed using Python.
- What are the busiest days of the week and hours of the day?
- Are there particular times of the day when people spend the most money?
- Can the data be clustered into simpler price range groupings to help direct their efforts?
- Are there certain types of products that are more popular than others?
- What’s the distribution among users in regards to their brand loyalty?
- Are there differences in ordering habits based on a customer’s loyalty status?
- Are there differences in ordering habits based on a customer’s region?
- Is there a connection between age and family status in terms of ordering habits?
- What different classifications does the demographic information suggest?
- What differences can you find in ordering habits of different customer profiles?
- Data cleaning, wrangling and consistency checks
- Consider data ethics when dealing with customer information
- Merge all data sets into a single data set (over 32M records)
- Conduct exploratory data analysis
- Derive new variables and create flags (grouping and aggregating the data) to help with the analysis
- Create visualisations communicating insights for stakeholders
The full analysis was carried out using the following Python libraries in Jupyter Notebook:
- pandas | numpy | os | matplotlib pyplot | seaborn | scipy | plotly express
The results were then exported or copied into Excel.
The Instacart project brief and original data sets were provided by Career Foundry.
The following csv files are in folder 02_Data/02_1_Original_Data
- Customers, Products, Departments (used to create a data dictionary which was mapped to the dataframe)
And the two larger csv files can be downloaded
- Link to Orders_products_prior, Orders
The grey boxes in the first row represent the four original data sets that were eventually merged into the final dataset Orders_products_all.
The second row of coloured boxes represent the data sets after the cleaning process.
The final row represents the data sets after each of the merges.
Also available in pdf format
The two client data files - Analysis_all_customers and Analysis_active_customers - that would have been in folder 05_Sent_to_Client, but are too large (+8GB) can been downloaded along with the interactive treemap visualisations:
- Link to client data files and interactive treemaps