-# Copyright (c) 2023 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
)
for key in self._data.keys():
logging.info(f"\n\nDataframe {key}:\n")
- self._data[key] = pd.concat(
- data_lists[key],
- ignore_index=True,
- copy=False
- )
+ if len(data_lists[key]) == 0:
+ self._data[key] = pd.DataFrame()
+ elif len(data_lists[key]) == 1:
+ self._data[key] = data_lists[key][0]
+ else:
+ self._data[key] = pd.concat(
+ data_lists[key],
+ ignore_index=True,
+ copy=False
+ )
self._data[key].info(verbose=True, memory_usage="deep")
err_msg = self._validate_columns(key)
if err_msg: