Below is the code I'm trying to execute but I am getting the error:
KeyError: 'None of [RangeIndex(start=0, stop=54, step=1)] are in the [columns]'
I've tried feeding in columns a few ways using dev_cols, feeding in RangeIndex identical to the index of the dataframe. I'm just a bit stuck.
dev_sentences = []
dev_labels = []
for i, (label, words) in enumerate(read_from("dev.txt"), 1):
dev_sentences.append(words)
dev_labels.append(label)
dev_sentences = pd.DataFrame(dev_sentences)
dev_sentences = dev_sentences.applymap(str)
dev_cols = dev_sentences.columns
print(dev_cols)
print(dev_sentences)
dev = pd.DataFrame()
dev['dev_combined'] = dev[dev_sentences.columns].apply(lambda row: ' '.join(row.values.astype(str)), axis=1)