I have a folder with lots of .txt files. How can I read all the files in the folder and get the content of them with pandas?. I tried the following:
.txt
Something like this:
import glob l = [pd.read_csv(filename) for filename in glob.glob("/path/*.txt")] df = pd.concat(l, axis=0)
You have to take into account the header, for example if you want to ignore it take a look at the skiprows option in read_csv.