@shounakrockz47 wrote:
I have a data frame with following attributes :
CP- Counting point of vehicles
A-Junction- Starting node of a road
B-Junction- Ending node of a road
Road- Road name
Date- Date
Time- Time
Vehicle Count- Number of vehiclesI have found that the combination of CP , A-Junction and B-Junction is unique.
So , I can group the
dataframeusing these three (CP,A-Junction,B-Junction)CP A-Junction B-Junction Road Date Time Vehicle Count X1 A1 B1 R1 2000-06-09 7 10 X1 A1 B1 R1 2000-06-09 8 15 X1 A1 B1 R1 2000-06-09 9 18 X1 A1 B1 R1 2000-06-09 10 12 X1 A1 B1 R1 2000-06-09 11 25 X2 A1 B1 R1 2000-06-09 7 15 X2 A1 B1 R1 2000-06-09 8 20 X2 A1 B1 R1 2000-06-09 8 20How can I find the correlation between these combinations?
I want to build a correlation matrix
(X1-A1-B1) (X2-A1-B1) .... (X1-A1-B1) 1 <some value> (X2-A1-B1) <some value> 1Is there any way I can do this ?
Edit1
dictAMV={} for name,groups in group_by_lat_lon: grp=group_by_lat_lon.get_group(name) if(name in dictAMV.keys()): print("This key ",name," already exists") else: amvListTemp=[] for index,row in grp.iterrows(): amvListTemp.append(row['Vehicle_count']) dictAMV[name]=amvListTempI am able to form a dictionary which contains all vehicle counts .
Now , how can I build the matrix .Can you please help ?
Posts: 3
Participants: 2