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 libaries | |
| from PIL import Image | |
| import pandas as pd | |
| from PIL import Image, ImageOps, ImageDraw | |
| from PIL import ImageFont | |
| from barcode import EAN13 | |
| from barcode.writer import ImageWriter | |
| # Import the file | |
| df = pd.read_excel('label information.xlsx') |
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
| SKU | SKU Code | Arrow | Zone | Cell | Loc | Location | log | arrow | cat | special | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 6549541941942 | 8 | 067 | 49 | 1 | 067-49-1 | Pieces | Arrow Red | Dress | GOH | |
| 2 | 6388908160619 | 1 | 064 | 13 | 2 | 064-13-2 | Carton | Arrow Red Rev | Tie | RFID | |
| 3 | 6035901125615 | 5 | 062 | 12 | 9 | 062-12-9 | Carton | Arrow Red Rev | Shoes Lady | Label | |
| 4 | 6380994358294 | 3 | 058 | 79 | 5 | 058-79-5 | Carton | Arrow Green Rev | Jewelry | Danger | |
| 5 | 7056603542859 | 2 | 055 | 76 | 8 | 055-76-8 | Pieces | Arrow Green | Jewelry | Sprinkler |
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
| # Bar Plot: split per lines per orders | |
| fig, ax = plt.subplots(figsize=(12, 6)) | |
| df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[0], color='tab:blue', legend= True, ax = ax) | |
| df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[1], color='tab:red', legend= True, ax = ax) | |
| df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[2], color='tab:orange', legend= True, ax = ax) | |
| df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[3], color='darkblue', legend= True, ax = ax) | |
| df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[4], color='brown', legend= True, ax = ax) | |
| df_lior.plot.bar(figsize=(10, 6), edgecolor='black', x='WEEK', y=COLS_IN[5], color='grey', legend= True, ax = ax) | |
| plt.xlabel('Week', fontsize = 14) | |
| plt.ylabel('Number of Orders', fontsize = 14) |
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
| # Add Analysis lines | |
| total_orders, LIST_ANALYSIS = plot_split(df_lior) | |
| # Create a slide | |
| slide = prs.slides.add_slide(image_slide_layout) | |
| shapes = slide.shapes | |
| # Create Title | |
| title_shape = shapes.title | |
| title_shape.text = 'Order Profile' | |
| # Add Image |
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
| '''Slides Analysis per Week''' | |
| for WEEK in LIST_WEEKS: | |
| # Create Plot | |
| avg_ratio, max_ratio, busy_day, max_lines, total_lines = analysis_week(df_day, WEEK) | |
| # Create a slide | |
| slide = prs.slides.add_slide(image_slide_layout) | |
| shapes = slide.shapes | |
| # Create Title |
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
| # Create the presentation object | |
| prs = Presentation() | |
| # Layout Choice for the introduction slide | |
| image_slide_layout = prs.slide_layouts[5] | |
| page = 1 | |
| '''Slide Introduction''' | |
| # Create the slide | |
| title_slide_layout = prs.slide_layouts[0] |
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 30 columns, instead of 8 in line 2.
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
| Order Time,Order Date,City,Store,#Shipment,Order Amount,Transmission OnTime,Transmission,Start PickPack,Pickpack,Loading,Expected Loading Date,Loading OnTime,Loading Date,Airport Arrival,Airport OnTime,Airport Arrival Date,Takeoff,Landing,Landing Date,Landing OnTime,Start Clearance,End Clearance,Leaving Airport,Store Arrival,Store Arrival Date,Delivery OnTime,Delivery Time,Extraction Time,Last Status | |
| 2021-05-02 17:00:00.000000,2021-05-02,CITY1,CITY1/ST8,2021-05-02/CITY1/ST8/1,9538,False,2021-05-03 17:00:00.000000,2021-05-04 07:00:00.000000,2021-05-04 15:08:01.811817,2021-05-04 19:00:00.000000,2021-05-04,True,2021-05-04,2021-05-04 22:28:26.955442,True,2021-05-04,2021-05-05 06:00:00.000000,2021-05-05 18:45:10.610100,2021-05-05,True,2021-05-06 09:00:00.000000,2021-05-06 11:14:17.533875,2021-05-06 12:07:20.920092,2021-05-06 17:01:17.840106,2021-05-06,False,2021-05-07 16:30:00.000000,2021-05-11 10:00:00,Delivery Time | |
| 2021-05-09 12:00:00.000000,2021-05-09,CITY2,CITY2/ST9,2021-05-09/CITY2/ST9/2,5735,True,2021-05-09 |
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
| from gtts import gTTS | |
| import pandas as pd | |
| import xlrd | |
| def do_TTS(hanzi): | |
| tts = gTTS(text=hanzi, lang='zh-CN') | |
| # Filename | |
| filename = hanzi[0:10] + '.mp3' | |
| # Save | |
| tts.save(filename) |
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 jieba, itertools | |
| def to_pinyin(sentence): | |
| segments = jieba.cut(sentence) | |
| output = " ".join(segments) | |
| pinyined = pinyin(output) | |
| combined = list(itertools.chain.from_iterable(pinyined)) | |
| return ''.join(combined) | |
| # Import |
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 PyPDF2 | |
| # Open the report | |
| pdfFileObj = open('example.pdf', 'rb') | |
| # Launch pdf reader object | |
| pdfReader = PyPDF2.PdfFileReader(pdfFileObj) | |
| # number of pages in pdf | |
| n_pages = pdfReader.numPages) |