Reputation: 412
What seems to be a simple function returns NaNs instead of the actual numbers. What am I missing here?
#Concatenate the dataframes:
dfcal = dfcal.astype(float)
dfmag = dfmag.astype(float)
print('dfcal\n-----',dfcal)
print('dfmag\n-----',dfmag)
df = pd.concat([dfcal,dfmag])
print('concatresult\n-----',df)
Cheers!
Upvotes: 1
Views: 44
Reputation: 87
Check parameters (join, axis) or use merge
join{‘inner’, ‘outer’}, default ‘outer’
df = pd.concat([dfcal,dfmag], join='inner')
Upvotes: 2
Reputation: 862571
I guess you need axis=1
for append new columns, selected column caliper
for avoid duplicated depth
columns:
df = pd.concat([dfcal['caliper'],dfmag], axis=1)
Or:
df = pd.concat([dfcal.drop('depth', axis=1),dfmag], axis=1)
Upvotes: 2