Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
print("Abt Missing Data:")
|
| 2 |
+
print(abt_df.isnull().sum())
|
| 3 |
+
|
| 4 |
+
print("\nBuy Missing Data:")
|
| 5 |
+
print(buy_df.isnull().sum())
|
| 6 |
+
|
| 7 |
+
import matplotlib.pyplot as plt
|
| 8 |
+
|
| 9 |
+
# Calculate string lengths
|
| 10 |
+
abt_df['name_length'] = abt_df['name'].str.len()
|
| 11 |
+
buy_df['name_length'] = buy_df['name'].str.len()
|
| 12 |
+
|
| 13 |
+
# Plot them side-by-side
|
| 14 |
+
plt.hist(abt_df['name_length'], alpha=0.5, label='Abt Product Names', bins=30)
|
| 15 |
+
plt.hist(buy_df['name_length'], alpha=0.5, label='Buy Product Names', bins=30)
|
| 16 |
+
plt.legend()
|
| 17 |
+
plt.title("How long are the product names?")
|
| 18 |
+
plt.show()
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
print(f"Abt Price Range: ${abt_df['price'].min()} to ${abt_df['price'].max()}")
|
| 22 |
+
print(f"Buy Price Range: ${buy_df['price'].min()} to ${buy_df['price'].max()}")
|