aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-11-03 13:34:47 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2017-11-03 13:34:47 +0100
commit22e7064c433fbff2e0d5bea521d5267569547560 (patch)
tree0d16c8f3212ad8fd6876782a08720edcfa9fbdb8 /src
parent2ad72b84363f9652439c90ecdb013a75497ee72a (diff)
downloadee-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')
-rw-r--r--src/ee/kicad/__init__.py6
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.