Question: ( , ) means that both users in and know each other. The dataset social_graph.csv contains 2 columns: ( , ), which are user IDs.

( , ) means that both users in and know each other.

The dataset social_graph.csv contains 2 columns: ( , ), which are user IDs.

(a) Load the social_graph.csv into a dataframe. Compute the number of unique users and show all unique user IDs.

(b) For each user, compute the number of users whom s/he directly knows and visualize the result using a bar chart.

(c) Visualize the relationship graph by referring to the tutorial of NetworkX

(d) Compute the number of unique groups of 3 users who know each other (triangles). Display who are the 3 users in each identified group to justify the answer.

(e) Compute and show the adjacency matrix A of the social graph

The adjacency matrix has the shape of (, ), where is the number of unique

users.

i,j = 1 if the user with the ID = knows the user with the ID = . Otherwise, i,j

= 0.

is a row index and is a column index.

CSV is as follows:

from to 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 10 0 11 0 12 0 13 0 17 0 19 0 21 0 31 1 2 1 3 1 7 1 13 1 17 1 19 1 21 1 30 2 3 2 7 2 8 2 9 2 13 2 27 2 28 2 32 3 7 3 12 3 13 4 6 4 10 5 6 5 10 5 16 6 16 8 30 8 32 8 33 9 33 13 33 14 32 14 33 15 32 15 33 18 32 18 33 19 33 20 32 20 33 22 32 22 33 23 25 23 27 23 29 23 32 23 33 24 25 24 27 24 31 25 31 26 29 26 33 27 33 28 31 28 33 29 32 29 33 30 32 30 33 31 32 31 33 32 33

Need solutions to compare. Using Pandas.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!