1
I’m trying to concatenate one CSV file with another. My goal is to remove data from an HTML daily and my routine should take a csv file called 'old data' where there is a dataframe saved in csv, and when it runs again should create a new updated file and concater this new file with the old one. After this happens he should erase the repeated data and adding only the new ones to the csv file, creating a new 'old data' so that tomorrow the routine runs again. I’m using:
#a.to_csv('dado_antigo.csv')
b = pd.read_csv('dado_antigo.csv',
index_col='Data',
parse_dates= ['Data'])
#arquivo concatenado
c = pd.concat((b,a))
aa, bb = np.unique(c, return_index=True)
c = c.ix[bb]
c = pd.read_csv('dado_antigo.csv')
And I get this mistake:
Indexerror: indices are out-of-Bounds
How could I fix it? Thank you.