Python Forum
Apply textual data cleaning to several CSV files - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Apply textual data cleaning to several CSV files (/thread-37683.html)



Apply textual data cleaning to several CSV files - ErcoleL99 - Jul-09-2022

I need to perform a textual analysis that includes several speeches. The speeches were transcribed (using OCR) from several PDFs files into CSVs files. Each CSV file contains a column titled speech, with several speeches from different speakers (one speaker, one row). I wrote a function to "clean" a little the most common shortfalls of the OCR. I applied this function to a single files and it does the job. Therefore, I am now trying to apply this function to all CSVs files. However, I keep getting the error "TypeError: expected string or bytes-like object". However, when I apply the code to a single file it does work, so I am stuck...Can someone help me? Any suggestion is appreciated.