diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-11-03 13:34:47 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-11-03 13:34:47 +0100 |
commit | 22e7064c433fbff2e0d5bea521d5267569547560 (patch) | |
tree | 0d16c8f3212ad8fd6876782a08720edcfa9fbdb8 /src/ee/kicad | |
parent | 2ad72b84363f9652439c90ecdb013a75497ee72a (diff) | |
download | ee-python-22e7064c433fbff2e0d5bea521d5267569547560.tar.gz ee-python-22e7064c433fbff2e0d5bea521d5267569547560.tar.bz2 ee-python-22e7064c433fbff2e0d5bea521d5267569547560.tar.xz ee-python-22e7064c433fbff2e0d5bea521d5267569547560.zip |
o Sort and remove missing values from dataframes created from Schematics objects too.
Diffstat (limited to 'src/ee/kicad')
-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. |