How to Calculate Correlation Between Bitcoin & Ethereum in Python

In this article, we will calculate Pearson's correlation (often thought of as linear correlation) for Bitcoin (BTC) and Ethereum (ETH) using two different methods in Python. The timeseries data will come from the Gemini exchange page on our site; and we will use the daily interval (correlation can be measured at smaller time intervals as well). The two libraries we will use are: Pandas & SciStats. Interestingly, the SciStats method will also calculate a p-value for the relationship. The code is fully documented --> meaning each line so that you can easily follow the code logic! There are numerous resources available to learn more about correlation and the math behind it, so we will not cover those here. Code resources below

Notice: Information contained herein is not and should not be construed as an offer, solicitation, or recommendation to buy or sell securities. The information has been obtained from sources we believe to be reliable; however no guarantee is made or implied with respect to its accuracy, timeliness, or completeness. Author does not own the any crypto currency discussed. The information and content are subject to change without notice. CryptoDataDownload and its affiliates do not provide investment, tax, legal or accounting advice.

This material has been prepared for informational purposes only and is the opinion of the author, and is not intended to provide, and should not be relied on for, investment, tax, legal, accounting advice. You should consult your own investment, tax, legal and accounting advisors before engaging in any transaction. All content published by CryptoDataDownload is not an endorsement whatsoever. CryptoDataDownload was not compensated to submit this article. Please also visit our Privacy policy; disclaimer; and terms and conditions page for further information.

Latest Posts
Follow Us
Notify me of new content