jupyter miniproject compiled_REV1 (autosaved) Ed View Insert Cell Kernel Widgets Help Run C Markdown File 5 x21 ↑ I 2000
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
jupyter miniproject compiled_REV1 (autosaved) Ed View Insert Cell Kernel Widgets Help Run C Markdown File 5 x21 ↑ I 2000
In [665]: plt. figure(figsize=(10, 7)) plt.scatter(data[:,0], data[:,1], cecluster. labels, cnape' rainbow) Out 655) Ceatplotlib.collections.PathCollection at ex192e4a7cdc0> 120000 100000 80000 60000 40000 20000 AKO 655 20 40 35 21, atyperint64) 200 In [666]: SupermarketData, isnull().sum() Out front. Stone Anna 1000 1200 1400
In [ ]: In [659]: supermarket data = pd. read_csv('stores.csv') In [660]: Out [660]: In [661]: Out [661]: supermarket_data.shape (896, 5) supermarket_data.head() Store ID Store_Area Items_Available Daily Customer_Count Store_Sales 0 1 2 32 1 Store Sales 2 3 5 1659 1461 1340 1451 1770 In [662]: In [663]: plt.figure(figsize=(10, 7)) 1961 1752 1609 1748 2111 data = supermarket_data.iloc[:, 3:5].values 530 210 720 620 450 plt.title("Customer Dendograms") dend=shc.dendrogram (shc.linkage(data, method='ward")) 66490 39820 54010 53730 46620
[662]: data= supermarket data.iloc[:, 3:5].values [663]: plt.figure(figsize=(10, 7)) plt.title("Customer Dendograms") denda shc.dendrogram(she.linkage (data, methods'ward")) Customer Dendograms 00000 500000 3 400000 In [664] clusters AgglomerativeClusteringin clusteress, affinitys euclidean, linkagesward") cluster.fit predict(data) 100000 Out[nay[1, , 2, 2, 2. 2, 2, 0, 1, 0, 4, 8, 2, 3, 4, 4, 1, IT E X 4 R ( % 45 B T 4, 1, 1, 1, 1, 2, 6 1, 0, 4, 0, 2, 1, 2, 2, 3, 7, 1, 1, 2, 2, 3, 4, 1 Y & 7 FB U * EP 8 1
665]: plt.figure(figsize=(10, 7)) plt.scatter(data[:,0], data[:,1], c-cluster.labels, cmap="rainbow') [665]: <matplotlib.collections.PathCollection at 0x192e4a7cdc0> 120000 1, 2, 0, 1, 3, 2, 1, 0, 4, 1, 0, 4, 4, 0, L dy dy dy 4, 2, 4, 2, 2, 4, 3, 2, 1, 1, 0, 3, 2, 0, 3, 3, 2, 3, 1, 2, 2, 1, 4, 0, 2, 4, 0, 4, 1, 1, 0, 0, 4, 4, 2, 3, 4, 1, 2, 0, 2, 0, 0, 4, 0, 0, 4, 0, 0, 3, 4, 0, 2, 1, 3, 1, 3, 4, 4, 2, 1, 4, 3, 2, 3, 2, 1, 0, 2, 0, 2, 2, 1, 1, 3, 4, 3, 1, 4, 4, 3, 3, 2, 0, 1, 2, 1, 2, 1, 1, 1, 2, 1, 0, 1, 4, 2, 0, 4, 4, 0, 4, 1, 1, 4, 3, 2, 3, 4, 1, 2, 3, 4, 2, 4, 1, 0, 1, 1, 4, 3, 1, 2, 2, 2, 4, 1, 2, 3, 2, 4, 3, 3, 3, 1, 1, 3, 2, 1, 0, 2, 2, 2, 2, 4, 1, 2, 2, 0, 4, 0, 2, 1, 4, 0, 2, 0, 4, 0, 4, 1, 2, 2, 4, 4, 2, 2, 1, 4, 4, 1, 1, 4, 1, 0, 3, 4, 3, 0, 1, 2, 4, 2, 0, 2, 0, 0, 0, 3, 1, 3, 1, 2, 3, 1, 2, 3, 4, 3, 4, 4, 1, 1, 1, 2, 2, 0, 1, 1, 3, 0, 2, 1, 1, 3, 1, 3, 2], dtype=int64) 100000 80000 60000 40000 20000 200 800 1000 1200 1400 L 1600 4
Edit View Insert Cell Kernel Widgets Help CMarkdown 20 Name: Store Sales, dtype: float64 n [672]: data = pd.read_csv('Stores.csv') idssdata[ 'Store ID '] In [673]: data.isnull().sum() Out [673]: Area Items Customer Sales dtype: int64 Run data.drop('Store ID ,axis=1, inplace=True) data data.rename (columns=("Store Area": "Area", "Items Available": "Items", "Daily Customer Count": "Customer", "Stor 4 plt.show() 0 In [674]: sb.set_theme(style="ticks") 2500- 0 0 0 2000- 1500- g=sb.pairplot (data, diag kinds"kde", corner=True) g.map_lower(sb.kdeplot, levelss), colors".2") V Not Trusted I Py