Data Science: Python interview questions: Fizz Buzz

I am going to start with a simple exercise called the Fizz Buzz exercise that is too easy to get asked at interview for data science but is a useful starting place for me. I have done a bit of Python in the form of a Udemy course but of course you forget all the content so fast, so I thought recording these exercises might be a good way to discipline myself.

This link describes the exercise and gives a solution. “Write a simple program that prints the numbers from 1 to N. But for multiples of three print “Fizz” instead of the number. For the multiples of five print “Buzz”. And, for multiples of both three and five print, “FizzBuzz”.”

This exercise does not rely on any of the libraries such as pandas or numpy, so is a good starting point.

I didn’t know that the % sign in Python gives you remainder of when you divide one number by another. E.g. 10%2 would give an output of 0.

First I wrote down how to do this with an if statement for a single number that is defined:

Next, I wrote a loop without using a function for numbers 1 to 16:

Then I used a function which probably isn’t necessary:

Calling the function finally:

Parentood: Fertility Treatment

How many people out there are having fertility treatment? “About 6% of married women aged 15 to 44 years in the United States are unable to get pregnant after one year of trying. Also, about 12% of women aged 15 to 44 years in the United States have difficulty getting pregnant or carrying a pregnancy to term, regardless of marital status.” According to the Center for Disease Control. That’s a lot of people, walking around, working, acting normal but being poked, prodded, and needled, asked to leave samples left right and center all the while living with that sinking feeling that they had failed somehow. And yes, rationally of course, your brain tells you that it’s not your fault, there’s nothing you can change to make it better, but it’s hard to think straight sometimes.

My own journey is quite strange in that a first child was easy enough to conceive, I didn’t really give it a second thought. So I assumed that it would be oh so simple once again. Except that it wasn’t. It didn’t happen for years. I was so utterly disappointed every time I tested, spending so much! on pregnancy tests. I finally went to see the doctor who for some strange reason decided to do a painful fallopian tube test without testing for other things. Fun. They could find nothing with either myself or my partner, diagnosis: “unexplained infertility.” Off we were sent to an amazing fertility clinic, where the wonderful doctor who loved talking about Star Trek, recommended I have a thyroid test, bingo, hypothyroidism. Of course, I have no idea whether this condition was definitively causing fertility issues, but it was nice to know that I had been feeling lethargic and not like myself for a reason. After taking medication for this, I was able to conceive but miscarried at 6 weeks with “blighted ovum” which was a strange experience as there was no actual embryo there. Anyway, we eventually decided to start oral medication and IUI which eventually worked. Let’s see how this all goes, the journey is not over yet.

Clothes that could be worn as maternity wear: dresses and sweatshirts

Who wants to buy a whole new wardrobe for a few months? Here are a few things that could stand a bump and then be worn afterwards as well, as well as some maternity options.

Anthropologie shift dress
Rebecca Minkoff sweatshirt
Gap long sleeve dress
Urban Outfitters sweatshirt
A Pea in the Pod dress
Kenzo sweatshirt
JCrew shirtdress
Rxmance sweatshirt
Topshop dress

Window shopping

What I want this week

Codename Villanelle:can’t wait for the next installment of the TV adaptation of this!
A new, lightweight concealer that stays on most of the day
I love this coat, however it’s no longer available in many sizes, maybe there’s just no plaid for me this spring
An excellent accompaniment to the Udemy course on Data Science with Python
Resistance bands still not sure what to with them apart from Glute bridges and duck-walk-type things
The prettiest cakestand
Not sure how well this game will go down with my family, but it looks quite fun

Data Science: Python

From speaking to data scientists, economists and machine learning analysts, it seems like there are two main choices for mainstream programming languages: Python and R, with Julia coming in third. Some interesting discussions here

Python is the fastest-growing as it has such comprehensive machine learning libraries. Therefore, I’ve decided to go for Python. There are so many free and paid online courses, that for now, I think doing that will suffice. I think this is a sensible overall plan for someone interested in getting ready for data science:

This is a great Medium post on how to go about creating your own data science learning experience, ranking all kinds of online courses.

1. Some of the courses available:

Udemy

Datacamp

Coursera

2. Doing data science practice questions

– Udemy course

Analytics Vidhya

Project Euler

3. Flashcards for myself testing basic statistics and other machine learning concepts

4. Set up a Github page with my own code that others can see? Not quite ready for this step yet.

Autoimmune disease: How to change my breakfast bias

As everyone knows autoimmune disease can be so frustrating as you don’t know when your symptoms are going to strike and how they will manifest themselves, but of course one of the things you can do in the mean time is take good care of yourself. One of my big challenges is diet: I am having trouble trying to increase my vegetable intake and reduce my sugar. I’ve always associated delicious breakfasts with jam toast, French toast or pancakes everyday. I feel super-irresponsible but then can’t seem to help myself in the moment.

Anyway, after thinking long and hard about sugar, and how much I hate being so addicted to it (instead of actually enjoying it anymore) I have tried switching breakfasts three times a week to eggs/tofu/fish in some form and vegetables. So far I’ve tried egg white scramble or fried eggs with one of the following:

  • a kind of ratatouille from eggplant, zucchini and tomatoes,
  • swiss chard, kale or spinach sauteed,
  • a mountain of peas with just a little butter or
  • pak choi
  • avocados and corn tortillas

Occasionally if I get up early enough, I’ll have pan fried salmon or tofu scramble as the protein instead of eggs.

An ambitious aim one day is to make dosas for breakfast, as it recently

Then as a reward there are pancakes or waffles twice a week. I decided to change over to using Kodiak Cakes to prepare them which do not taste the same by any means but I guess they’ll do for now. On weekends, I treat myself to buckwheat or, gasp, regular flour pancakes. I think because there are still some sweet breakfasts in there, I have been better about the savory ones. Let’s be honest, I’ll never love eating swiss chard for breakfast, but I guess it’s not too bad. What tricks do you use to get enough vegetables in the day?

Great links about this:

NBC

Saveur

Shape