Python Dont Copy Entire Code Work Inside Function Def Zipflaw Wf1 Need Create X Index List Q37170741

python. dont have to copy this entire code, just have to workinside the function def ZipfLaw(wf1): need to create x (index oflist from 1 to length of list) and y (normalised frequency of list,divide every element in list by sum of total number of words)createlists of length. Then need to take log transform of every elementthen do linear regression to find slope and expoential ofintercept. You dont have to plot. Thanks ·Write code to plot the normalized data from the file on a log-log plot using matplotlib. Your plot should include axes labelmport sys 2import re Bimport matplotlib.pyplot as plt 4 5######### HINT: These libraries are useful ######## 6from math impor26 27 # calculate 1) the slope (m) and 2) the intercept 28 # from the above equations by using stats. Linregress from SciPy 2the

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.