Professional Documents
Culture Documents
Common DS Interview Questions and Answers_5
Common DS Interview Questions and Answers_5
var2<- c("I","Love,"ProjectPro")
var2
# Lowercase
strng = strng.lower()
# Here is a dictionary that will contain each unique letter and its counts
c = {}
# If can’t find the letter in dictionary, add it and set the count to 1
if letter not in c:
c[letter] = 1
else:
c[letter] += 1
if c[strng[i]] == 1:
return i
return -1
# Test cases
print(f"Index: {frstuniquechar(strng=s)}")
def fact(num):
# Extreme cases
if num< 0: return -1
if num == 0: return 1
if num == 1:
return num
else:
# Recursion Used
# Test cases
print(f"{num}! = {fact(num=num)}")
Another way is to train and test data sets by sampling them multiple times. Predict
on all those datasets to determine whether the resultant models are similar and are
performing well.
By looking at the p-value, by looking at r square values, by looking at the fit of the
function, and analyzing as to how the treatment of missing value could have
affected- data scientists can analyze if something will produce meaningless results.