@TomAugspurger, I modified the example to be self-contained.. As you can see now better, the times in the original data are all multiple of 5 minutes. The resample attribute allows to resample a regular time-series data. hii @daniamarkumar 1. if you query historical data for 1 minute you will get data for previous trading day (and same trading day after 5-6 pm). # Import libraries import pandas as pd import numpy as np Create Data # Create a time series of 2000 elements, one very five minutes starting on 1/1/2000 time = pd . resample()— This function is primarily used for time series data. date_range ( '1/1/2000' , periods = 2000 , freq = '5min' ) # Create a pandas series with a random values between 0 and 100, using 'time' as the index series = pd . ; In both cases, data must be invented. I was able to check all the files one by one and spent almost 3 to 4 hours for checking all the files individually ( including short and long breaks ). Resampling involves changing the frequency of your time series observations. The first step is to define the dictionary with the conversion logic. Two types of resampling are: Upsampling: Where you increase the frequency of the samples, such as from minutes to seconds. It's energy usage data and there are peaks for 1-2 seconds that I would lose with resampling. 5 seconds/1 minute wouldn't change the fact that I still have to compute 4k/1k windows per day that need to be thrown away, rather than just being able to compute the needed 24 windows per day. We use the resample attribute of pandas data frame. The implementation of these is shown below where a 1-minute frequency data is converted to 10-minute frequency data. Pandas is one of those packages and makes importing and analyzing data much easier.. Pandas dataframe.resample() function is primarily used for time series data. ; Downsampling: Where you decrease the frequency of the samples, such as from days to months. It is a Convenience method for frequency conversion and resampling of time series. We shall resample the data every 15 minutes … Resampling. For us, we have the Housing Price Index sampled at a one-month rate, but we could sample the HPI every week, every day, every minute, or more, but we could also resample at every year, every 10 years, and so on. In this case, you want total daily rainfall, so you will use the resample() method together with .sum(). Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. pandas is giving you a resampled data at the beginning of the day. Stock prices are intra-second. Another environment where resampling almost always occurs is with stock prices, for example. Now you mix 2 timeframes and: 2015-03-13 10:01:00 (1-minute timeframe) happens actually later than 2015-03-13 00:00:00 (1-day resampled by pandas) Which wouldn't really make sense. But no worries, I can use Python Pandas. When you evaluate the interpolation at the exact same timestamp as in the original data, the result should be different than the original data, by definition of smoothed spline. Bingo! Other than that, resampling to e.g. A time series is a series of data points indexed (or listed or graphed) in time order. Pandas provide two very useful functions that we can use to group our data. To aggregate or temporal resample the data for a time period, you can take all of the values for each day and summarize them. i see you need 1 minute data for live trading session.. so as suggested by @rakeshr you should "you can make ltp API call exact at start and end of every minute , and store ltp value at your end(may be in DB),and calculate change over any period. In this case, you can use the pandas resample method to convert the stock market data to the frequency of your choice.