This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create_json(df_nodes, df_links): | |
| ''' Create json from dataframes''' | |
| json1 = [] | |
| for index, row in df_nodes.reset_index().iterrows(): | |
| dico = {} | |
| dico['group'] = int(row['group']) | |
| dico['name'] = row['name'] | |
| json1.append(dico) | |
| json2 = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "links": [ | |
| { | |
| "source": 0, | |
| "target": 0, | |
| "value": 1947 | |
| }, | |
| { | |
| "source": 0, | |
| "target": 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| d3.json("/get-json").then(function(brands) { | |
| var matrix = [], | |
| nodes = brands.nodes, | |
| n = nodes.length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub SaveMSG_as_HTML() | |
| Application.ScreenUpdating = False | |
| 'Initiliaze Parameters | |
| Dim olMsg As MailItem | |
| Dim strPath As String | |
| Dim strMsg As String | |
| Dim strHTML As String | |
| Dim Sender, Received_Time As String | |
| Dim ID As Integer | |
| ID = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'Loop through each (.msg) file in your folder strIn | |
| Do While myFile <> "" | |
| 'Create record in Excel File | |
| On Error Resume Next | |
| Sheets(1).Cells(ID + 1, 1) = ID | |
| Sheets(1).Cells(ID + 1, 7) = myFile | |
| 'Open (.msg) file | |
| Set olMsg = Session.OpenSharedItem(strIn & myFile) | |
| strName = ID & ".html" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub SaveMSG_as_HTML() | |
| Application.ScreenUpdating = False | |
| Dim olMsg As MailItem | |
| Dim strPath As String | |
| Dim strMsg As String | |
| Dim strHTML As String | |
| Dim Sender, Received_Time As String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DATE_FORMAT | ORDER_NUMBER | SKU | BOX | |
|---|---|---|---|---|
| 01/01/2017 | 835220 | 290731 | 1.0 | |
| 01/01/2017 | 835220 | 373272 | 1.0 | |
| 01/01/2017 | 835214 | 362101 | 1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| # Import | |
| df = pd.read_excel('In/' + '1-2017.xlsx') | |
| print("{:,} order lines for {:,} orders".format(len(df), df.ORDER_NUMBER.nunique())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # BOX/SKU | |
| df_par = pd.DataFrame(df.groupby(['SKU'])['BOX'].sum()) | |
| df_par.columns = ['BOX'] | |
| # Sort Values | |
| df_par.sort_values(['BOX'], ascending = False, inplace = True) | |
| df_par.reset_index(inplace = True) | |
| # Cumulative Sum | |
| df_par['CumSum'] = df_par['BOX'].cumsum() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| index | SKU | BOX | CumSum | %CumSum | %SKU | |
|---|---|---|---|---|---|---|
| 1 | 359803 | 4810 | 4810 | 2.911658 | 0.020559 | |
| 2 | 290478 | 4132 | 8942 | 5.412898 | 0.041118 | |
| 3 | 366639 | 4104 | 13046 | 7.897190 | 0.061678 | |
| 4 | 359958 | 4062 | 17108 | 10.356058 | 0.082237 | |
| 5 | 253500 | 3879 | 20987 | 12.704149 | 0.102796 |