code to convert dataset to binary