Loading...

How to Combine Two Timeseries Together Into Single Pandas DataFrame in Python


Combining Timeseries DataFrames
From time to time, you may run into situations where you are going to want to combine timeseries from separate files into the same file. We will use data from FTX to combine hourly spot BTC/USDT timeseries with hourly BTC Perpetual futures data in the below code. The ability to combine timeseries on a common index (the timestamp) will open doors to other analysis and the creation of all new timeseries. The most key step is ensuring that the index is set properly. Data is loaded from our respective FTX page. We use Pandas Dataframes to 1) change the index 2) drop unimportant columns 3) rename our remaining column 4) join our timeseries together 5) add a human-readable date time to the dataframe




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