Update pages/1_Data_Card_and_Data_collection.py
Browse files
pages/1_Data_Card_and_Data_collection.py
CHANGED
|
@@ -42,7 +42,8 @@ df = st.session_state.get("dataset")
|
|
| 42 |
|
| 43 |
if df is not None:
|
| 44 |
st.subheader("Dataset Preview:")
|
| 45 |
-
|
|
|
|
| 46 |
|
| 47 |
st.subheader("Info of the Dataset:")
|
| 48 |
# Redirect the output of df.info() to a string buffer
|
|
@@ -50,14 +51,36 @@ if df is not None:
|
|
| 50 |
df.info(buf=buffer)
|
| 51 |
|
| 52 |
# Display the content in Streamlit
|
| 53 |
-
st.
|
| 54 |
|
| 55 |
st.subheader("Dataset Shape (Rows, Columns):")
|
| 56 |
st.write(df.shape)
|
| 57 |
else:
|
| 58 |
st.info("No dataset found. Please upload a CSV file.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
# Define the URL of the background image (use your own image URL)
|
| 60 |
background_image_url = "https://cdn-uploads.huggingface.co/production/uploads/67441c51a784a9d15cb12871/xpoN_mbctlrQAgRU06EPt.jpeg"
|
|
|
|
| 61 |
# Apply custom CSS for the background image and overlay
|
| 62 |
st.markdown(
|
| 63 |
f"""
|
|
@@ -80,12 +103,20 @@ st.markdown(
|
|
| 80 |
background: rgba(0, 0, 0, 0.4); /* Adjust transparency here (0.4 for 40% transparency) */
|
| 81 |
z-index: -1;
|
| 82 |
}}
|
| 83 |
-
|
|
|
|
| 84 |
.stMarkdown {{
|
| 85 |
-
color: white;
|
| 86 |
-
font-size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
}}
|
| 88 |
</style>
|
| 89 |
""",
|
| 90 |
unsafe_allow_html=True
|
| 91 |
-
)
|
|
|
|
| 42 |
|
| 43 |
if df is not None:
|
| 44 |
st.subheader("Dataset Preview:")
|
| 45 |
+
# Display the dataset with a center alignment
|
| 46 |
+
st.write(df, use_container_width=True) # Set to use container width
|
| 47 |
|
| 48 |
st.subheader("Info of the Dataset:")
|
| 49 |
# Redirect the output of df.info() to a string buffer
|
|
|
|
| 51 |
df.info(buf=buffer)
|
| 52 |
|
| 53 |
# Display the content in Streamlit
|
| 54 |
+
st.text(buffer.getvalue())
|
| 55 |
|
| 56 |
st.subheader("Dataset Shape (Rows, Columns):")
|
| 57 |
st.write(df.shape)
|
| 58 |
else:
|
| 59 |
st.info("No dataset found. Please upload a CSV file.")
|
| 60 |
+
|
| 61 |
+
st.markdown('''# About the Dataset
|
| 62 |
+
|
| 63 |
+
## Description:
|
| 64 |
+
This dataset provides insights into consumer electronics sales, featuring product categories, brands, prices, customer demographics, purchase behavior, and satisfaction metrics. It aims to analyze factors influencing purchase intent and customer satisfaction in the consumer electronics market.
|
| 65 |
+
|
| 66 |
+
## Features:
|
| 67 |
+
- **ProductID**: Unique identifier for each product.
|
| 68 |
+
- **ProductCategory**: Category of the consumer electronics product (e.g., Smartphones, Laptops).
|
| 69 |
+
- **ProductBrand**: Brand of the product (e.g., Apple, Samsung).
|
| 70 |
+
- **ProductPrice**: Price of the product ($).
|
| 71 |
+
- **CustomerAge**: Age of the customer.
|
| 72 |
+
- **CustomerGender**: Gender of the customer (0 - Male, 1 - Female).
|
| 73 |
+
- **PurchaseFrequency**: Average number of purchases per year.
|
| 74 |
+
- **CustomerSatisfaction**: Customer satisfaction rating (1 - 5).
|
| 75 |
+
- **PurchaseIntent** (Target Variable): Intent to purchase.
|
| 76 |
+
|
| 77 |
+
## Conclusion:
|
| 78 |
+
This dataset facilitates analysis on consumer behavior and purchase patterns in the consumer electronics sector, providing valuable insights into market dynamics and customer preferences.
|
| 79 |
+
''')
|
| 80 |
+
|
| 81 |
# Define the URL of the background image (use your own image URL)
|
| 82 |
background_image_url = "https://cdn-uploads.huggingface.co/production/uploads/67441c51a784a9d15cb12871/xpoN_mbctlrQAgRU06EPt.jpeg"
|
| 83 |
+
|
| 84 |
# Apply custom CSS for the background image and overlay
|
| 85 |
st.markdown(
|
| 86 |
f"""
|
|
|
|
| 103 |
background: rgba(0, 0, 0, 0.4); /* Adjust transparency here (0.4 for 40% transparency) */
|
| 104 |
z-index: -1;
|
| 105 |
}}
|
| 106 |
+
|
| 107 |
+
/* Styling the content to ensure text visibility */
|
| 108 |
.stMarkdown {{
|
| 109 |
+
color: white;
|
| 110 |
+
font-size: 20px; /* Adjust font size for better readability */
|
| 111 |
+
text-align: center; /* Center align the text */
|
| 112 |
+
}}
|
| 113 |
+
|
| 114 |
+
/* Center align the dataset and info */
|
| 115 |
+
.stTable {{
|
| 116 |
+
margin: 0 auto;
|
| 117 |
+
text-align: center;
|
| 118 |
}}
|
| 119 |
</style>
|
| 120 |
""",
|
| 121 |
unsafe_allow_html=True
|
| 122 |
+
)
|