0% found this document useful (0 votes)
4 views1 page

Quantium Task1 Python Conversion Part1

The document outlines the first part of a Python conversion task for a virtual internship focused on retail strategy and analytics. It includes data loading, preprocessing steps such as date conversion, product name analysis, and filtering of transaction data. Further sections on analysis and insights will be provided in subsequent parts of the project.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Quantium Task1 Python Conversion Part1

The document outlines the first part of a Python conversion task for a virtual internship focused on retail strategy and analytics. It includes data loading, preprocessing steps such as date conversion, product name analysis, and filtering of transaction data. Further sections on analysis and insights will be provided in subsequent parts of the project.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Quantium Virtual Internship - Retail Strategy and Analytics - Task 1

Python Conversion (Part 1)

import pandas as pd
import numpy as np
import [Link] as plt
import seaborn as sns
from [Link] import ttest_ind

file_path = "YOUR_FOLDER_PATH/"

transactionData = pd.read_csv(file_path + "QVI_transaction_data.csv")


customerData = pd.read_csv(file_path + "QVI_purchase_behaviour.csv")

[Link]()

[Link]()

[Link]()

transactionData["DATE"] = pd.to_datetime(
transactionData["DATE"],
origin="1899-12-30",
unit="D"
)

transactionData["PROD_NAME"].value_counts().head(20)

product_words = transactionData["PROD_NAME"].[Link]().explode()

product_words.value_counts().head(20)

product_words = product_words[
~product_words.[Link](r"\d|&", regex=True)
]

transactionData = transactionData[
~transactionData["PROD_NAME"].[Link]().[Link]("salsa")
]

[Link](include="all")

transactionData[transactionData["PROD_QTY"] == 200]

customer_id = transactionData[
transactionData["PROD_QTY"] == 200
]["LYLTY_CARD_NBR"].iloc[0]

transactionData[
transactionData["LYLTY_CARD_NBR"] == customer_id
]

transactionData = transactionData[
transactionData["LYLTY_CARD_NBR"] != customer_id
]

Note:
The remaining sections of the R Markdown file (date analysis, feature engineering,
customer segmentation, statistical testing, deep dive analysis and insights) will
be included in the following parts of the complete PDF conversion.

You might also like