If you are new to R, we recommend R for Marketing Research and Analytics by Chris Chapman and Elea McDonnell Feit. The book is practical and provides repeatable R code. Part I & II of the book cover basics of R programming and foundational statistics. It is an excellent book on marketing analytics.
If you are new to Python, we recommend the Python version of the book mentioned above, Python for Marketing Research and Analytics by Jason Schwarz, Chris Chapman, and Elea McDonnell Feit.
If you want to dive deeper into some of the book’s topics, there are many places to learn more.
For machine learning, Python Machine Learning 3rd Edition by Raschka and Mirjalili is a good book on implementing machine learning in Python. Apply Predictive Modeling by Kuhn and Johnston is an applied, practitioner-friendly text using R package
For statistics models in R, a recommended book is An Introduction to Statistical Learning (ISL) by James, Witten, Hastie, and Tibshirani. A more advanced treatment of the topics in ISL is The Elements of Statistical Learning by Friedman, Tibshirani, and Hastie.