Coverage for mlprodict/tools/cleaning.py: 100%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2@file
3@brief Better display.
4"""
7def clean_error_msg(df):
8 """
9 Removes EOL from error messages in dataframes.
11 @param df dataframe
12 @return df dataframe
13 """
14 def clean_eol(value):
15 if isinstance(value, str):
16 return value.replace("\n", " -- ")
17 return value
19 df = df.copy()
20 for c in df.columns:
21 if "ERROR" in c:
22 df[c] = df[c].apply(clean_eol)
23 return df