Valueerror: The Truth Value Of A Dataframe Is Ambiguous. Use A.empty, A.bool(), A.item(), A.any() Or A.all()
I try to forward a data to excel but received the subject error. I want to combine some of excel files into one excel file. First I created all_info array in order to collect all d
Solution 1:
Do you maybe want to do something like this?
fnames = ['sample1.xls', 'sample2.xls']
all_info = [pd.read_excel(f, 'Sheet1') for f in fnames]
df = pd.concat(all_info)
df.to_excel("all_info.xlsx")
Here, all_info is a list of DataFrames, where each elements is holding the different Excel Data. Then they are concatenated into one DataFrame and saved to disk...
Post a Comment for "Valueerror: The Truth Value Of A Dataframe Is Ambiguous. Use A.empty, A.bool(), A.item(), A.any() Or A.all()"