hannahawalsh / ESG_AI

88 stars 40 forks source link

Update and rename Graph.py to Optimized_Graph.py #6

Open thisisvk45 opened 2 months ago

thisisvk45 commented 2 months ago

summary of the changes:

Simplified Pairing: I combined the steps to group by URL and generate organization pairs into one line, making the code cleaner and faster.

Easier Weight Calculation: I used a built-in function to directly calculate how many times each organization pair appears, getting rid of extra loops.

Cleaner Graph Building: I created the graph directly from a simplified DataFrame, avoiding duplicate edges and unnecessary steps.