Question: This assignment needs the file karate _ club _ interactions.txt on the D 2 L . Load this file into a Python variable through command
This assignment needs the file karateclubinteractions.txt on the DL
Load this file into a Python variable through command nploadtxt seen in class. This will result in a binaryvalued Numpy D array, which shows the interactions among members of a Karate club, such that if the ijth element of the D array is one, the the ith and jth members had an interaction eg a fight otherwise they did not. Note that such relationship is symmetric the fact that the ith member had an interaction with the jth member readily implies that the jth member also had an interaction with the ith member Verify this symmetry by means of Numpy tools ie its transpose is the same as itself
Write a function that takes an interaction matrix, extracts some information from it and prints them out. The function should first verifies symmetry of the input D array, and then answer the following questions. Note that the analysis should be fully based on Numpy methods and functions; no point will be given if a question is answered by any other means.
How many members did the Karate club have?
Print how many interactions each member of the club had. Interactions of the ith member could be retrieved by means of either the ith row or the ith column of the loaded array. Either way would be fine for the purpose of this assignment.
What are indices of the least and most active members of the club? Did they have any interaction with them?
What is the average and STD of the number of interactions across all the members?
Text file data format:
eeeeeeeeee
eeeeeeeeee
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
