Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nic
gridsource
Commits
978a2fac
Commit
978a2fac
authored
Nov 24, 2020
by
Nic
Browse files
cosmetics
parent
2e8773e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
gridsource/io.py
View file @
978a2fac
...
...
@@ -85,7 +85,7 @@ def read_excel(fpath, sheet_name=None, engine=DEFAULT_EXCEL_ENGINE):
"""read excel file using pandas"""
df_dict
=
pd
.
read_excel
(
fpath
,
sheet_name
=
sheet_name
,
engine
=
engine
)
# remove any blank lines
return
{
k
:
df
.
dropna
(
how
=
'
all
'
)
for
k
,
df
in
df_dict
.
items
()}
return
{
k
:
df
.
dropna
(
how
=
"
all
"
)
for
k
,
df
in
df_dict
.
items
()}
def
read_configobj
(
fpath
,
sheet_name
=
None
,
row_prefix
=
"sniff"
):
...
...
gridsource/validation.py
View file @
978a2fac
...
...
@@ -429,7 +429,7 @@ class DataFrameSchematizer:
df_num
[
col
]
=
df_num
[
col
].
pint
.
to
(
units
)
df
=
pd
.
concat
((
df_num
.
pint
.
dequantify
(),
df_nonnum
),
axis
=
1
)
# re-arrange columns: restrict to level 0 and reorder as initially
df
.
columns
=
[
t
[
0
]
for
t
in
df
.
columns
.
tolist
()]
df
.
columns
=
[
t
[
0
]
for
t
in
df
.
columns
.
tolist
()]
df
=
df
[[
c
for
c
in
initial_without_urow
.
columns
]]
# =====================================================================
# fill empty values as requested by schema
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment