  The transverse momentum spectra of D$^0$ mesons from b hadron decays are
measured at midrapidity ($|y|$ $<$ $1$) in pp and PbPb collisions at a
nucleon-nucleon center of mass energy of 5.02 TeV with the CMS detector at the
LHC. The D$^0$ mesons from b hadron decays are distinguished from prompt D$^0$
mesons by their decay topologies. In PbPb collisions, the B $\to$ D$^0$ yield
is found to be suppressed in the measured $p_\mathrm{T}$ range from 2 to 100
GeV$/c$ as compared to pp collisions. The suppression is weaker than that of
prompt D$^0$ mesons and charged hadrons for $p_\mathrm{T}$ around 10 GeV$/c$.
While theoretical calculations incorporating partonic energy loss in the
quark-gluon plasma can successfully describe the measured B $\to$ D$^0$
suppression at higher $p_\mathrm{T}$, the data show an indication of larger
suppression than the model predictions in the range of 2 $\lt$ $p_\mathrm{T}$
$\lt$ 5 GeV$/c$.
