1

Could someone give me a tip on how to merge two CSV files based on time stamp? Concat works, but I also need to organize the data based on one single stamp, DateTime. In the shell output snip below both DateTime columns are visible. Thank you

import pandas as pd
import numpy as np
import datetime

WUdata = pd.read_csv('C:\\Users\\bbartling\\Documents\\Python\\test_SP 
data\\3rd GoRound k Nearest\\WB data\\WU\\WUdata.csv')

print(WUdata.describe())
print(WUdata.shape)
print(WUdata.columns)
print(WUdata.info())

kWdata = pd.read_csv('C:\\Users\\bbartling\\Documents\\Python\\test_SP 
data\\3rd GoRound k Nearest\\WB data\\WU\\kWdata.csv')

print(kWdata.describe())
print(kWdata.shape)
print(kWdata.columns)
print(kWdata.info())

merged = pd.concat([WUdata, kWdata], axis=1)

print(merged)

enter image description here

cmaher
  • 5,100
  • 1
  • 22
  • 34
bbartling
  • 3,288
  • 9
  • 43
  • 88
  • 2
    See this question on how to ask a good Pandas question http://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples – Zero Sep 20 '17 at 19:48
  • It is not clear what you mean by "based on time stamp", and "organize the data". Do you want to concatenate two dataframes and align on the DataTime columns? – Karthik V Sep 20 '17 at 20:16
  • Hello, I am trying to merge the data sets together organized by date & time. Each data set has the same exact time stampt. And if there is a data is both datasets on exactly the same date & time, I think one of the time stamps would need to be eliminated...? Thanks – bbartling Sep 21 '17 at 12:47

0 Answers0