I have two different dataframe and one of them is as below
df1=
Datetime BSL
0 7 127.504505
1 8 115.254132
2 9 108.994275
3 10 102.936860
4 11 99.830400
5 12 114.660522
6 13 138.215339
7 14 132.131075
8 15 121.478006
9 16 113.795645
10 17 114.038462
the other one is df2=
Datetime Number of Accident
0 7 3455
1 8 17388
2 9 27767
3 10 33622
4 11 33474
5 12 12670
6 13 28137
7 14 27141
8 15 26515
9 16 24849
10 17 13013
the first one Blood Sugar Level of people based on time (7 means between 7 am and 8 am) the second one is number of accident between these times
when I try to this code
df1.corr(df2, "pearson")
I got as error:
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
How can I solve it? Or, how can I test correlation between two different variables?