Skip to content

Instantly share code, notes, and snippets.

@jaiswalakshay508-maker
Created May 3, 2026 13:06
Show Gist options
  • Select an option

  • Save jaiswalakshay508-maker/8df88d2d7a138ea9d24fab1867ef3c82 to your computer and use it in GitHub Desktop.

Select an option

Save jaiswalakshay508-maker/8df88d2d7a138ea9d24fab1867ef3c82 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-12-05T12:30:51.825382Z",
"start_time": "2025-12-05T12:30:51.815020Z"
}
},
"cell_type": "code",
"source": "import pandas as pd",
"id": "6e1966ac6dee2bef",
"outputs": [],
"execution_count": 8
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-12-05T12:29:20.017414Z",
"start_time": "2025-12-05T12:29:19.912932Z"
}
},
"cell_type": "code",
"source": [
"retail_df=pd.read_csv('retail_sales_dataset.csv')\n",
"print(retail_df.head())"
],
"id": "2d68a6cf2ab1bd04",
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Customer ID Gender Age Product Category Quantity Price per Unit\n",
"0 CUST001 Male 34 Beauty 3 50\n",
"1 CUST002 Female 26 Clothing 2 500\n",
"2 CUST003 Male 50 Electronics 1 30\n",
"3 CUST004 Male 37 Clothing 1 500\n",
"4 CUST005 Male 30 Beauty 2 50\n"
]
}
],
"execution_count": 5
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-12-05T12:36:18.991061Z",
"start_time": "2025-12-05T12:36:18.984135Z"
}
},
"cell_type": "code",
"source": [
"def product_appeal(Age):\n",
" if Age<=30:\n",
" return 'Youth Appeal'\n",
" elif Age>45:\n",
" return 'Mature Appeal'\n",
" else:\n",
" return 'General Appeal'\n",
" retail_df['Product_Appeal']=retail_df[\"Age\"]\n",
" retail_df.head()\n"
],
"id": "ca508f87d786d471",
"outputs": [],
"execution_count": 10
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment