The theory of data assimilation and machine learning is introduced in an accessible and pedagogical manner, with a focus on the underlying statistical physics. This modern and cross-disciplinary book is suitable for undergraduate and graduate students from science and engineering without specialized experience of statistical physics.