@@ -31,13 +31,13 @@ def convert_results_to_dataframe(
3131 results_dataframe = normalized_dataframe
3232 )
3333 if set_id_as_index and "id" in normalized_dataframe .columns :
34- normalized_dataframe = normalized_dataframe .set_index ("id" )
34+ normalized_dataframe .set_index ("id" , inplace = True )
3535
3636 return normalized_dataframe
3737
3838
3939def __format_results_columns (results_dataframe : pd .DataFrame ) -> pd .DataFrame :
40- """Format results column keep properties at the end.
40+ """Format results column to keep properties at the end.
4141
4242 Args:
4343 results_dataframe: Dataframe of results.
@@ -46,7 +46,7 @@ def __format_results_columns(results_dataframe: pd.DataFrame) -> pd.DataFrame:
4646 Formatted dataframe of results.
4747 """
4848 column_headers = results_dataframe .columns .to_list ()
49- formatted_column_headers = [
49+ standard_column_headers = [
5050 header for header in column_headers if __is_standard_column_header (header )
5151 ]
5252 status_type_summary_header = [
@@ -57,13 +57,13 @@ def __format_results_columns(results_dataframe: pd.DataFrame) -> pd.DataFrame:
5757 properties_headers = [
5858 header for header in column_headers if __is_property_header (header = header )
5959 ]
60- formatted_column_headers += status_type_summary_header + properties_headers
60+ standard_column_headers += status_type_summary_header + properties_headers
6161
62- return results_dataframe .reindex (columns = formatted_column_headers )
62+ return results_dataframe .reindex (columns = standard_column_headers , copy = False )
6363
6464
6565def __is_standard_column_header (header : str ) -> bool :
66- """Check if column header is not a status type summary or property.
66+ """Check if column header is not status type summary or property.
6767
6868 Args:
6969 header: column header for results dataframe.
0 commit comments