Spaces:
Sleeping
Sleeping
Update Code_2_7.py
Browse files- Code_2_7.py +14 -1
Code_2_7.py
CHANGED
|
@@ -1568,13 +1568,26 @@ def mainFunctionDrawImgPdf(datadoc,dxfpath, dxfratio,SearchArray,pdfpath=0,pdfna
|
|
| 1568 |
SimilarAreaDictionary.reset_index(drop=True, inplace=True)
|
| 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 |
|
| 1580 |
SimilarAreaDictionary = grouped_df
|
|
|
|
| 1568 |
SimilarAreaDictionary.reset_index(drop=True, inplace=True)
|
| 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 |
grouped_df = SimilarAreaDictionary.groupby('Color').agg({
|
| 1580 |
+
'Guess':'first',
|
| 1581 |
'Occurences': 'sum', # Sum of occurrences for each color
|
| 1582 |
'Area':'first',
|
| 1583 |
'Total Area': 'sum', # Sum of areas for each color
|
| 1584 |
'Perimeter':'first',
|
| 1585 |
'Total Perimeter': 'sum', # Sum of perimeters for each color
|
| 1586 |
+
'Length':'first',
|
| 1587 |
+
'Total Length':'first',
|
| 1588 |
+
'Texts':'first',
|
| 1589 |
+
'Comments':'first'
|
| 1590 |
+
|
| 1591 |
}).reset_index()
|
| 1592 |
|
| 1593 |
SimilarAreaDictionary = grouped_df
|