mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
IfcFM now supports writing to Pandas Dataframes
This commit is contained in:
@@ -36,6 +36,12 @@ except:
|
|||||||
pass # No ODF support
|
pass # No ODF support
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
import pandas as pd
|
||||||
|
except:
|
||||||
|
pass # No Pandas support
|
||||||
|
|
||||||
|
|
||||||
class Parser:
|
class Parser:
|
||||||
def __init__(self, preset="basic"):
|
def __init__(self, preset="basic"):
|
||||||
self.file = None
|
self.file = None
|
||||||
@@ -239,3 +245,9 @@ class Writer:
|
|||||||
r += 1
|
r += 1
|
||||||
|
|
||||||
workbook.save(output)
|
workbook.save(output)
|
||||||
|
|
||||||
|
def write_pd(self):
|
||||||
|
results = {}
|
||||||
|
for category, data in self.categories.items():
|
||||||
|
results[category] = pd.DataFrame(data["rows"], columns=data["headers"])
|
||||||
|
return results
|
||||||
|
|||||||
Reference in New Issue
Block a user