Home > other >  According to specific characters with excel adjacent cell string
According to specific characters with excel adjacent cell string

Time:11-28

Such as topic, topic master in crawl data when some semantically related content is divided into the different rows, want to according to the special field merge adjacent cell string,
In my question, I hope will be the second column of the cell by line read, judge the first character is "the first", if it is, it reads the next line of the second column, before met before the second "the first" both in front of the content is merged into a "first" in the cell,
Data format for ". XLSX "excel file, there are two columns,
In the image below, for example,
6, 7 lines to merge, 8,9,10 belong to the same provision, content to merge,
Do you have bosses know what to do?

CodePudding user response:

With pandas reading

Determine the Item column the data is not "the first" word, merger

  • Related