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
59a34371
Commit
59a34371
authored
Nov 21, 2020
by
Nic
Browse files
[io] clean blank lines when reading excel (dropna)
parent
519b6f3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
gridsource/io.py
View file @
59a34371
...
...
@@ -83,7 +83,9 @@ def read_data(fpath, sheet_name=None, engine=DEFAULT_EXCEL_ENGINE):
def
read_excel
(
fpath
,
sheet_name
=
None
,
engine
=
DEFAULT_EXCEL_ENGINE
):
"""read excel file using pandas"""
return
pd
.
read_excel
(
fpath
,
sheet_name
=
sheet_name
,
engine
=
engine
)
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
()}
def
read_configobj
(
fpath
,
sheet_name
=
None
,
row_prefix
=
"sniff"
):
...
...
Write
Preview
Supports
Markdown
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