I'm trying to concatenate one csv file with another. My goal is to extract data from an HTML every day and my routine should get a csv file called 'old_date' where a saved dataframe is located in csv, and when I run again I should create a new updated file and concatenate this new file with the old one . After this happens it should delete the repeated data and adding only the new ones to the csv file, creating a new 'old_date' so that the routine will run again tomorrow. 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 error:
IndexError: indices are out-of-bounds
How could you solve it? Thank you.