When you combine two data frames with an index that combines with some values, but not at all using "external" merging, python / pandas automatically adds Null (NaN) values ββto fields that cannot match. Fine this is normal behavior, but it changes the data type. This is a problem because now you need to repeat what data types the columns should have.
fillna or dropna () does not seem to save data types immediately after merging. Or do I need a table structure?
Normally, I will run numpy np.where (field.isnull (), etc.), but that means it works for all columns.
What is the workaround for this?
python pandas
Jeff
source share