I stored a calculated variable in another file let's say A.txt as follows:
123
1123
123
123
123
...
I want to use single variable each time from file A.txt (sequentially) when each acb.* read by pandas, processing acb.* multiples files that I was doing as follows using pandas: (how do I read acb.* file in numeric order like 1 then 2 and so on?)
import pandas as pd
import numpy as np
import glob
for filename in sorted(glob.glob('acb.*')):
with open(filename) as f:
df = pd.read_table(f, sep=" ", skiprows=2)
How to combine this two task simultaneously? I know we can read two files at single time in pandas but how do I use single variable from file A.txt each time when I read a acb.* file sequentially?