How to Define a Function in Python + R (and Make Someone's Day)

How to Define a Function in Python + R (and Make Someone's Day)

This week is a little special for me because the Python code you see below was hand written on a Birthday card given to me by one of my daughters! It was a great opportunity rewrite this code in R to perform the same operation! Granted singing happy birthday may not be a typical data science job to be done but knowing how to use functions in both languages is an essential skill for all data scientists.

A function that sings happy birthday written in Python

Here is how you might write a function in R to perform the same task.

A function that sings happy birthday written in R

Imagine receiving a Birthday card from your own child written in code? When you are passionate about the work you do those who are closest to you will take notice. Not only may you be creating an exciting new career opportunity for yourself but you may also inspire your own family and friends to follow something they are wholeheartedly passionate about too!

Remember to like and subscribe to the Data Science Code in Python + R newsletter to get your weekly reminder and commit to learning a little more Python and/or R every week. Each newsletter covers how to do one data science job in both Python and R.

?? Matt Dancho ??

Sharing my journey to becoming a Generative AI Data Scientist. Join 1,000+ in my next free workshop. ??

2 å¹´

Happy Birthday, Matt! ?? it’s been an absolute pleasure to be part of your data science journey and to see your growth. You are a role model for aspiring data scientists. Keep up the awesome work!! ??

Gezahagn Negash Seboka

Research Team Leader & GIS Analyst

2 å¹´

Thanks for sharing

要查看或添加评论,请登录

Matt Rosinski的更多文章

社区洞察

其他会员也浏览了