Best coding tips for data scientists

Manpreet Singh
5 min readNov 18, 2021

Welcome back! Data science is an awesome field with tons of growth, if you’re new to data science, check out the link below to learn more about this career path:

One of the biggest tools within data science is coding, so let’s talk about some of the best coding tips for data scientists! The specific languages we’ll be hitting on in this article are Python and R!

Python

Finding Differences In a List

Next up, an awesome functionality with Python is being able to find the differences in a list. Now, let’s take a look at the following example:

set1 = [ 1, 2, 3, 4, 5 ]set2 = [ 3, 4, 5, 6, 7 ]

Based on this code, we have just created 2 lists full of numbers, now let’s say we wanted to find which numbers are not in both the lists, we can use the set() function:

set(set1) — set(set2)

The output will be the numbers not in both:

Hiding Warnings

--

--

Manpreet Singh
Manpreet Singh

Responses (1)