Skip to content

Commit 692519d

Browse files
Remove call to pd.Dataframe().columns.droplevel(1)
1 parent 9616d4e commit 692519d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/changesummary.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,16 @@ def _get_discovery_differences(self, filename):
122122
# `Key`, `CurrentValue`, `NewValue`.
123123
combined_docs = (
124124
pd.concat([current_doc, new_doc], keys=["CurrentValue", "NewValue"])
125+
# Drop the index column
126+
.reset_index(drop=True,level=1)
127+
# Transpose the DataFrame, Resulting Columns should be
128+
# ["Key", "CurrentValue", "New Value"]
129+
.rename_axis(['Key'], axis=1)
125130
.transpose()
126-
.rename_axis(index="Key")
131+
# Drop the index column
127132
.reset_index()
128133
)
129134

130-
# This line is for cleanup purposes. As a result of the previous code
131-
# we have a multi-index which is not needed so we need to drop a level.
132-
combined_docs.columns = combined_docs.columns.droplevel(1)
133-
134135
# When discovery documents are added, the column `CurrentValue` will
135136
# not exist. In that case, we'll just populate with `np.nan`.
136137
if "CurrentValue" not in combined_docs.columns:

0 commit comments

Comments
 (0)