I am new to Python. I got two sets of data shown as below.
Gmt time,Open,High,Low,Close,Volume,RSI,,Change,Gain,Loss,Avg Gain,Avg Loss,RS
print(daily['Gmt time'].date == hourly['Gmt time'].date)
First read the data sets into dataframes:
import pandas as pd df_one = pd.DataFrame.from_csv('data_set_one.csv', index_col=False) df_two = pd.DataFrame.from_csv('data_set_two.csv', index_col=False)
Convert date column to date
df_one['Gmt date'] = pd.to_datetime(df_one['Gmt time']).dt.date df_two['Gmt date'] = pd.to_datetime(df_two['Gmt time']).dt.date
now compare both the dataframes:
for i, row in df_one.iterrows(): df_one_date = row['Gmt date'] print('df_one_date', df_one_date) print(df_two[df_two['Gmt date'] == df_one_date]) print('----')
it's still unclear how you want to handle for different dates from df_one to match df_two. Hope this gives you enough idea on how to handle it.