<human>:  How to remove 0's converting pandas dataframe to record
<bot>: Here is some code to convert dataframe `df` to integer-type sparse object

df.to_sparse(0)

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.