diff --git a/pandas_ods_reader/tools.py b/pandas_ods_reader/tools.py index d039176..36bcf5f 100644 --- a/pandas_ods_reader/tools.py +++ b/pandas_ods_reader/tools.py @@ -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():