BANA 7025: Data Wrangling with Python

Week 1: Getting Started

Welcome to BANA 7025

Brad Boehmke


  • Phonetically: “Bem” + “Key”

  • Alternatives:

    • Dr. / Professor B
    • Brad
  • Contact:

    • Read Communication Expectations Canvas page first!
    • Email: boehmkbc@ucmail.uc.edu
    • Office: Lindhall 3412




Fun Fact: Golf Obsessed


Today’s Agenda


  • What is data wrangling and why does it matter?
  • Course overview, goals, & roadmap
  • AI & Tooling
  • Q&A

What is Data Wrangling

The Dirty Secret of Data Science

Before you can analyze data, you have to fix it.

Data in the wild is messy:

  • 🧹 Missing values, duplicate records, inconsistent formats
  • 🔀 Data spread across multiple files that need to be joined
  • 📐 Columns that need to be renamed, reshaped, or recalculated
  • 🗓️ Dates stored as text, numbers stored as strings


Important

Studies consistently show data scientists spend 50–80% of their time cleaning and preparing data — not modeling.

What Is Data Wrangling?

The process of cleaning, transforming, summarizing, and visualizing data to extract meaningful insights

flowchart LR
  A[Raw Data] --> B[Clean]
  B --> C[Transform & Aggregate]
  C --> D[Join & Reshape]
  D --> E[Visualize & Summarize]
  E --> F[Insight]

It’s the full skill of working with data end-to-end — from fixing a messy import to building a chart that tells a story.

Important

Data wrangling is not a detour on the way to analysis — it is the work.

Data Wrangling is All Around Us

Important

No ML model, optimization system, or AI tool works without clean, prepared data first.

  • 🛒 Kroger must join loyalty card transactions with product catalogs and household profiles before building a personalized coupon recommendation system
  • 🏥 Hospitals must clean, reshape, and aggregate patient records across departments before training readmission prediction models
  • 📦 Amazon must transform raw clickstream logs into structured, summarized features before any recommendation algorithm can run
  • 🏈 NFL teams must merge and wrangle player tracking data from dozens of sources before building performance optimization models
  • 📊 Finance teams must reconcile, clean, and reshape data from disparate systems before fraud detection or forecasting models can be built

Why Should You Care?

Meet Taylor

Taylor is a graduating M.S. in Business Analytics student who just landed her first full-time role at a retail analytics firm.

Taylor has a solid foundation:

  • Statistics and modeling knowledge ✓
  • Business acumen ✓
  • Critical thinking ✓

Taylor knows how to think about data!

Taylor’s First Week on the Job

The manager drops three raw data files and says:

“We’re trying to understand what drives repeat purchases. Can you clean this up and pull together something useful by Friday?”

Taylor opens the files and freezes. 😰

What’s missing? The hands-on ability to take raw, messy files and wrangle them into something ready for analysis.


Important

That gap is exactly what this course closes.

Does this scenario sound familiar?

It’s your turn to experience this…

You’ll get three datasets:

  • 🧾 Customer Transactions (messy!)
  • 🛒 Product Information
  • 👥 Customer Demographics

Download the data from

https://tinyurl.com/retail-data

Your mission:

  1. Get this data into a form where you can start answering: “What drives repeat purchases?”
  2. Can you get some initial insights from the data?

Group Activity: Dig Into the Data

Work in groups of 2–3. Use any tools you have (Excel, Python, intuition) and try to answer:

  • 🛒 Which products have the highest repeat purchase rate?
  • 👥 Are certain types of customers buying these products more frequently?
  • 📅 Is there a time pattern — do repeat purchases cluster around certain days or weeks?
  • 🧹 What data quality issues did you run into? Missing values? Inconsistent formats?
  • 🔀 How did you connect information across the three files?

Please work on this for 15 minutes.

Important

Don’t worry about getting the “right” answer — focus on what’s hard about the process.

Debrief: What Did You Learn?

Let’s talk through what you found:

  • 🛒 Were you able to identify which products had the highest repeat purchase rate? What made it hard?
  • 👥 Did any customer segments stand out? How did you figure that out?
  • 📅 Did you find any time patterns — and how did you look for them?
  • 🧹 What data quality issues slowed you down?
  • 🔀 How did you connect the three files — and what would have helped?

Tip

If you couldn’t complete the task — or didn’t know where to start — that’s exactly the point. By the end of this course, this will feel straightforward.

Key Takeaways:

  • Real-world data is never clean or ready to analyze
  • Good data work starts with understanding the structure and quality of your data
  • This course will teach you to clean, reshape, join, transform, and start analyzing data with Python

Tip

We’ll revisit this exact challenge at the end of the semester — and it’ll feel completely different.

Course Overview

Why Data Wrangling for YOUR Career

Regardless of where your career takes you, one thing is constant: you will work with data.

  • 📊 M.S. Business Analytics → Data wrangling is the foundation every model, dashboard, and insight is built on
  • 💻 M.S. Information Systems → Integrating and preparing data across systems is a core technical skill
  • 🤖 Certificate in AI → Clean, well-structured data is what separates working AI systems from broken ones
  • 🎯 Any advanced degree → Employers increasingly expect you to get your hands on data — not just interpret results someone else prepared

Being able to do this with code is a key differentiator!

Important

The bottleneck in most organizations is not analysis — it’s getting data ready for analysis.

What You’ll Learn in BANA 7025

flowchart LR
  A[Raw Data] --> B[Import & Inspect]
  B --> C[Clean]
  C --> D[Wrangle]
  D --> E[Join & Reshape]
  E --> F[Visualize]
  F --> G[Insight]

By the end of this course, you’ll be able to:

  • Write Python code to import and inspect data from multiple sources
  • Clean messy data: handle missing values, fix types, standardize formats
  • Transform, filter, sort, group, and aggregate data with pandas
  • Join multiple tables and reshape data for analysis
  • Visualize data clearly and effectively
  • Write reusable functions to automate data preparation tasks

Important

Most courses in your program focus on the Insight box — applying models to extract answers. This course builds everything that makes those models possible and their results trustable.

AI Reality Check

What About AI? Won’t It Do This for Me?

“Why do I need to learn data wrangling when ChatGPT can just clean my data?”

It’s a fair question. Let’s talk about it honestly.

🤖 AI tools are incredible accelerators, but they’re not magic:

  • They don’t understand your data’s context or meaning
  • They can’t catch errors they don’t know to look for
  • They sometimes just make stuff up
  • They’re only as good as your prompts and judgment

AI Reality Check: It’s Like Autocorrect for Code!

Warning

Ever had your phone turn “on my way!” into “omg my weasel!”? 🦫

That’s exactly how AI coding tools work — they predict what comes next based on patterns they’ve seen.

Sometimes they nail it… sometimes you get digital weasels.

AI tools are assistants, not autopilots:

AI can help you:

  • Write boilerplate code
  • Debug errors
  • Learn new syntax
  • Generate ideas

AI cannot:

  • Understand YOUR data
  • Know YOUR business goals
  • Spot problems it wasn’t told about
  • Guarantee correct results

How We’ll Use AI in This Course

You’ll learn to use AI tools as learning partners, not crutches:

✅ Smart AI Use:

  • Check your understanding
  • Help debug when stuck
  • Explain concepts differently
  • Generate practice examples
  • Always understand what the code does

❌ Avoid This:

  • Copy-paste without understanding
  • Skip the learning struggle
  • Rely on AI for everything
  • Submit AI code you can’t explain

Important

The future belongs to people who know how to collaborate with AI, not be replaced by it.

Course Roadmap & Learning Mindset

Learning to Code: A Reality Check

Let’s be honest — learning to code can be frustrating at first.

You might feel:

  • 😤 Confused by error messages
  • 🤯 Like everyone else “gets it” but you
  • 😮‍💨 Stuck on simple problems
  • 🙄 Like you’re just copying examples

This is normal. It’s expected.

Learning to Code = Learning a New Language

You’ll start by copying examples and Googling ChatGPTing errors.

Over time, you’ll stop memorizing and start thinking in code.

This course is designed for beginners — we’ll get you there step by step!

Course Roadmap

Course Roadmap

Your 7-week journey through BANA 7025 looks roughly like this:

Week Topic Summary of Concepts Covered
1 Fundamentals I Coding environment setup, Python basics
2 Fundamentals II Jupyter notebooks, data structures, Python libraries
3 Pandas & Data Wrangling I Importing, subsetting, cleaning, filtering data
4 Pandas & Data Wrangling II Aggregating, merging, and joining data
5 Data Visualization Plotting libraries & exploratory data analysis
6 Efficient Code Control flow & writing functions
7 Intro to ML Intro to ML with scikit-learn

Important

Each week builds on the last — by week 7, you’ll have a complete data wrangling workflow.

How You’ll Learn

Each week follows a consistent rhythm:

  • 🧠 Tuesday (Lecture): Learn concepts, explore examples, discuss ideas
  • 💻 Thursday (Lab): Practice coding, get hands-on, work with real data

Assessments include:

  • 📚 Weekly reading quizzes
  • 📝 Homework assignments
  • 💭 Discussion forums
  • 📊 Final project

Important

Expect to build something meaningful — not just learn theory.

Resources

Everything You Need Is in One of Two Spots


📍 Course Canvas Page

📘 Course Textbook

Step 1

Who has read through the “Start Here!” module?

Let’s hit on a few important items

Tools & Setup Preview

Why Learn to Code? 🤔


  • Coding = flexibility + power
  • Handle real-world data: big, messy, inconsistent
  • Automate repetitive tasks
  • Think algorithmically and analytically

Why Python? 🤔


  • Widely used
  • Easy-to-read syntax (great for beginners)
  • Massive ecosystem: pandas, numpy, matplotlib, scikit-learn
  • Community support: tutorials, libraries, AI tools
  • Most organizations are shifting toward Python as the primary language for their data science and engineering codebases

Important

Python is the most valuable tool in your analytics toolbox.

How You’ll Run Python: Google Colab

What is Colab?

  • 💻 Free cloud-based Python environment from Google
  • 🚫 No software installation needed to get started
  • ✅ Works in your browser – just click and code

Why Colab First?

  • Easy, consistent experience for everyone on Day 1
  • Allows us to focus on learning — not debugging installs
  • We’ll gradually move toward installing tools locally (e.g., Anaconda, VS Code)

Important

You’ll be up and coding on Day 1 — no setup headaches!

Next Steps

Your Learning Journey Starts Now

📖 What Next?

  1. Read the “Start Here!” module on Canvas
  2. Work through Chapters 1–3 this week
  3. Get up and running in Colab

🗓️ Thursday Lab:

  • Your first Python code
  • Working in Google Colab
  • Collaborative problem-solving

💡 Remember: We’re building skills step-by-step!

Q&A

Q&A 🙋‍♀️

  • Open floor for any questions regarding the course structure, expectations, or content.
  • Discussion on how this course aligns with your academic and career goals.
  • Or anything else…golf?