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