misc: formatting
This commit is contained in:
parent
16ee03683f
commit
f6f1477231
|
|
@ -2,18 +2,20 @@
|
||||||
|
|
||||||
|
|
||||||
def ods_info(doc):
|
def ods_info(doc):
|
||||||
"""Prints the number of sheets, their names, and number of rows and columns
|
"""Print the number of sheets, their names, and number of rows and columns"""
|
||||||
"""
|
print("Spreadsheet contains {:d} sheet(s).".format(len(doc.sheets)))
|
||||||
print("Spreadsheet contains %d sheet(s)." % len(doc.sheets))
|
|
||||||
for sheet in doc.sheets:
|
for sheet in doc.sheets:
|
||||||
print("-"*40)
|
print("-" * 40)
|
||||||
print(" Sheet name : '%s'" % sheet.name)
|
print(" Sheet name : '{}'".format(sheet.name))
|
||||||
print("Size of Sheet : (rows=%d, cols=%d)" % (
|
print(
|
||||||
sheet.nrows(), sheet.ncols()))
|
"Size of Sheet : (rows={:d}, cols={:d})".format(
|
||||||
|
sheet.nrows(), sheet.ncols()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def sanitize_df(df):
|
def sanitize_df(df):
|
||||||
"""Drops empty rows and columns from the DataFrame and returns it"""
|
"""Drop empty rows and columns from the DataFrame and returns it"""
|
||||||
# Delete empty rows
|
# Delete empty rows
|
||||||
for i in df.index.tolist()[-1::-1]:
|
for i in df.index.tolist()[-1::-1]:
|
||||||
if df.iloc[i].isna().all():
|
if df.iloc[i].isna().all():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue