python - Merging dataframes in pandas - Keep getting key error? -


i'm trying merge 2 data frames, testr , testc, keep getting key error on "channel id" , not sure problem is. dataframes have same size or have same datatype pd.merge work? here code merge .info() on each dataframe:

def matchid_rc(rev,cost):     rc = pd.merge(rev, cost, on='channel id', how = 'outer')     return rc  testr.info() <class 'pandas.core.frame.dataframe'> int64index: 169 entries, 0 168 data columns (total 7 columns): channel id         169 non-null int64 channel name       169 non-null object impressions        169 non-null object fill rate          169 non-null object gross rev          169 non-null object impression fees    169 non-null object exchange fees      169 non-null object dtypes: int64(1), object(6) memory usage: 10.6+ kb  testc.info() <class 'pandas.core.frame.dataframe'> int64index: 63 entries, 0 62 data columns (total 3 columns): channel id    62 non-null object campaign      63 non-null object ad spend      63 non-null float64 dtypes: float64(1), object(2) memory usage: 2.0+ kb 

they need same data type. after all, can't compare whether string , integer same.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -