Question

Here is a portion of the csv to long to post it all... Name Gender SSN...

Here is a portion of the csv to long to post it all...

Name Gender SSN Member Date Phone State Zip Email Credit Card Credit Card_Number Credit Card Exp Gender Favorite Radio Station Purchases Past 30 Days Spent Past 30 Days Purchases Past 6 Months Spent Past 6 Months Purchases Past 12 Months Spent Past 12 Months
Mamie Mason female 459-69-6647 Mon Aug 01 2016 12:06:01 GMT-0400 (Eastern Daylight Time) 9.47E+09 Indiana 82439-3619 [email protected] Visa 4263xxxxxxxx1913 23-Sep female WMMZ 4 $2,149.81 7 $5,188.75 9 $10,756.50
Dr. Jorge Leonard male 267-90-8144 ######## (482) 962-5537 Pennsylvania 44795 [email protected] American Express 3430xxxxxxx6344 22-Jun male WLRS 4 $1,510.68 5 $3,679.59 15 $11,241.27
Sue Robertson female 431-17-5882 Fri Jun 03 2016 01:34:30 GMT-0400 (Eastern Daylight Time) (387) 395-7066 Virginia 97198 [email protected] American Express 3446xxxxxxx4624 21-Sep female WING 4 $2,094.67 9 $6,289.29 13 $11,071.11

PYTHON: CODE: import csv import re data = [] with open('customerData.csv') as csvfile: reader = csv.DictReader(csvfile) for row in reader: data.append(row) print(data[0]) print(data[1]["Name"]) print(data[2]["Spent Past 30 Days"])

OUTPUT: {'Name': 'Mamie Mason', 'Gender': 'female', 'SSN': '459-69-6647', 'Member Date': 'Mon Aug 01 2016 12:06:01 GMT-0400 (Eastern Daylight Time)', 'Phone': '9472284457', 'State': 'Indiana', 'Zip': '82439-3619', 'Email': '[email protected]', 'Credit Card': 'Visa', 'Credit Card_Number': '4263xxxxxxxx1913', 'Credit Card Exp': '09/23', 'Favorite Radio Station': 'WMMZ', 'Purchases Past 30 Days': '4', 'Spent Past 30 Days': '$2149.81', 'Purchases Past 6 Months': '7', 'Spent Past 6 Months': '$5188.75', 'Purchases Past 12 Months': '9', 'Spent Past 12 Months': '$10756.500000000002'} Dr. Jorge Leonard $2094.67

NEED: Remove social security numbers, the membership clock time stamp, and credit card information from the output. Revise the state and zip code entries. List states in a two-letter format without periods. List zip codes by the first five digits only. Data should first be organized by highest to lowest spent to analyze trends. After analyzing the highest profit over time, please look for patterns in location, then favorite radio stations. I need help writing this.

Homework Answers

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions