diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ee/kicad/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ee/kicad/__init__.py b/src/ee/kicad/__init__.py index d89c209..b51e7db 100644 --- a/src/ee/kicad/__init__.py +++ b/src/ee/kicad/__init__.py @@ -31,7 +31,11 @@ def to_pandas(obj: Any, **kwarg): def to_pandas_schematics(ss: Schematics): dfs = [to_pandas_schematic(schematic) for schematic in ss.schematics] - return pandas.concat(dfs) + df = pandas.concat(dfs). \ + sort_values(["ref_type", "ref_num"]). \ + applymap(lambda s: s if isinstance(s, str) else None) + + return df def to_pandas_schematic(sch: Schematic): # These fields will always be put first. |