Spaces:
Sleeping
Sleeping
Update Code_2_7.py
Browse files- Code_2_7.py +7 -2
Code_2_7.py
CHANGED
|
@@ -1569,11 +1569,16 @@ def mainFunctionDrawImgPdf(datadoc,dxfpath, dxfratio,SearchArray,pdfpath=0,pdfna
|
|
| 1569 |
|
| 1570 |
|
| 1571 |
grouped_df = SimilarAreaDictionary.groupby('Color').agg({
|
|
|
|
| 1572 |
'Occurences': 'sum', # Sum of occurrences for each color
|
| 1573 |
'Area':'first',
|
| 1574 |
'Total Area': 'sum', # Sum of areas for each color
|
| 1575 |
'Perimeter':'first',
|
| 1576 |
'Total Perimeter': 'sum', # Sum of perimeters for each color
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1577 |
|
| 1578 |
}).reset_index()
|
| 1579 |
|
|
@@ -1590,8 +1595,8 @@ def mainFunctionDrawImgPdf(datadoc,dxfpath, dxfratio,SearchArray,pdfpath=0,pdfna
|
|
| 1590 |
OutputPdfStage2=adjustannotations(modified_pdf_data,text_with_positions)
|
| 1591 |
latestimg,pix=pdftoimg(OutputPdfStage2)
|
| 1592 |
doc2 =fitz.open('pdf',OutputPdfStage2)
|
| 1593 |
-
|
| 1594 |
-
gc,spreadsheet_service,spreadsheetId, spreadsheet_url , namepathArr=google_sheet_Legend.legendGoogleSheets(
|
| 1595 |
# dbxTeam=tsadropboxretrieval.ADR_Access_DropboxTeam('user')
|
| 1596 |
# md, res =dbxTeam.files_download(path= pdfpath+pdfname)
|
| 1597 |
# data = res.content
|
|
|
|
| 1569 |
|
| 1570 |
|
| 1571 |
grouped_df = SimilarAreaDictionary.groupby('Color').agg({
|
| 1572 |
+
'Guess': 'first',
|
| 1573 |
'Occurences': 'sum', # Sum of occurrences for each color
|
| 1574 |
'Area':'first',
|
| 1575 |
'Total Area': 'sum', # Sum of areas for each color
|
| 1576 |
'Perimeter':'first',
|
| 1577 |
'Total Perimeter': 'sum', # Sum of perimeters for each color
|
| 1578 |
+
'Length':'first',
|
| 1579 |
+
'Total Length': 'sum', # Sum of lengths for each color
|
| 1580 |
+
'Texts': 'first', # Keep the first occurrence of 'Texts'
|
| 1581 |
+
'Comments': 'first' # Keep the first occurrence of 'Comments'
|
| 1582 |
|
| 1583 |
}).reset_index()
|
| 1584 |
|
|
|
|
| 1595 |
OutputPdfStage2=adjustannotations(modified_pdf_data,text_with_positions)
|
| 1596 |
latestimg,pix=pdftoimg(OutputPdfStage2)
|
| 1597 |
doc2 =fitz.open('pdf',OutputPdfStage2)
|
| 1598 |
+
|
| 1599 |
+
gc,spreadsheet_service,spreadsheetId, spreadsheet_url , namepathArr=google_sheet_Legend.legendGoogleSheets(grouped_df , pdfname,pdfpath)
|
| 1600 |
# dbxTeam=tsadropboxretrieval.ADR_Access_DropboxTeam('user')
|
| 1601 |
# md, res =dbxTeam.files_download(path= pdfpath+pdfname)
|
| 1602 |
# data = res.content
|