Examining the Raw Customer Data
Let's begin by examining our raw customer purchase data. This data represents daily purchases made by customers.
First, we need to navigate to the project directory. In Linux, we use the cd
command to change directories. The tilde (~
) is a shortcut that represents your home directory.
cd ~/project
This command changes our current working directory to /home/labex/project
. Now that we're in the correct directory, let's view the contents of our customer data file. We'll use the cat
command, which is short for "concatenate". It's commonly used to display the contents of files.
cat customer_purchases.txt
You should see output similar to this:
Alice,Electronics
Bob,Books
Charlie,Clothing
Alice,Electronics
David,Home Goods
Bob,Books
Eve,Toys
Charlie,Clothing
Frank,Sports
Alice,Electronics
This file contains customer names and their purchases, with some customers making multiple purchases. Each line represents a single purchase, with the customer's name followed by the category of item they purchased, separated by a comma.