-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Closed
Description
A merge or join involving a left DataFrame that has single precision floats will fail. Seems to be OK if the right dataframe has float32; these get cast to float64 (which they probably shouldn't be)
import numpy as np
import pandas
a = np.random.randint(0, 5, 100)
df = pandas.DataFrame({'a': a})
s = pandas.DataFrame( pandas.Series(np.random.random(5).astype('f'), name='md') )
df.merge(s, left_on='a', right_index=True) # this is OK
df['b'] = np.random.randint(0, 5, 100)
df.merge(s, left_on='a', right_index=True) # this is OK
df['c'] = np.random.random(100).astype('Float64')
df.merge(s, left_on='a', right_index=True) # this is OK
df['d'] = np.random.random(100).astype('Float32')
print df.dtypes
df.merge(s, left_on='a', right_index=True) # this fails