Pandas Convert float column containing nan values to int for merge operation
Pandas Convert float column containing nan values to int for merge operation Attempt #1 s["order_id"].apply(lambda x: int(x) if pd.notnull(x) else np.nan) Attempt #2 def to_int(x): if(pd.notnull(x)): return int(x) Attempt #3 s["order_id"] = s.loc[pd.notnull(s["order_id"]),"order_id].astype(int) All of these return a series where the values are still formatted as floats. I'm wondering if I could use the update function or take advantage of reindexing. Leveraging Indexing solution attempt: null = np.nan data = {"time":{"0":1528971021539,"1":1529289904697,"2":1529572773525,"3":1529892602301,"4":1530082881098,"5":1530069453264,"6":1528985491630,"7":1529236762719,"8":1529475504491,"9":1529814085541,"10":1529906568681,"11":1530160346468,"12":1529833559160,"13":1530051985183,"14":153024...
