Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python for Secret Agents

You're reading from  Python for Secret Agents

Product type Book
Published in Aug 2014
Publisher
ISBN-13 9781783980420
Pages 216 pages
Edition 1st Edition
Languages
Author (1):
Steven F. Lott Steven F. Lott
Author Profile Icon Steven F. Lott
Steven F. Lott
Toc

Comparisons and correlations


An important statistical question centers around correlation between variables. We often wonder if two sequences of values correlate with each other. If we have variables that correlate, perhaps we've found an interesting causal relationship. We might be able to use one variable to predict the values of another variable. We might also be able to prove that they're independent and have nothing to do with each other.

The essential statistical tool for this is the coefficient of correlation. We have several ways to compute this. One solution is to download NumPy or SciPy from the following links:

  • http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html

  • http://docs.scipy.org/doc/numpy/reference/generated/numpy.corrcoef.html

The correlation algorithms, however, aren't too complex. Implementing these two calculations will build up our basic data gathering espionage skills. We'll build some more basic statistical functions. Then, we'll build the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime