Breaking Down a Python Coding Challenge

Everything we do is practice for something greater than where we currently are.  Practice only makes for improvement. 

– Les Brown

One of the more important skills with coding is understanding how to break down a problem into smaller chunks. Especially when you’re first beginning, it’s easy to immediately start typing lines of code before you have fully thought through the problem.

I’m going to walk you through how I approached a recent code challenge. I’m currently at the point where I can usually get the job done, but my solution is not always the most efficient possible. Once I walk through my initial approach, I’ll share my instructor’s feedback and show you my revisions.

The Challenge

Create a game where the computer guesses the user’s number (an integer between 1 and 100 OR a given minimum and maximum) in the fewest tries possible. Also include a way to check it the user is cheating.

Step 1 – Understand the Problem

I started by considering a simpler version of the problem – guess a number between 1 and 10. I created a list of the numbers 1-10 and considered the most efficient way to narrow down the possible numbers.

I want to begin by guessing a number and asking the user if their number is less than, greater than or equal to my guess. If I start with a number close to one of the ends of the list, I may luck out and guess the answer quickly, but probability is not on my side here. As you can see, if 9 is guessed first, there is only a 20% chance that you can settle on the answer and an 80% chance that the target number is in the range of 1-8.

A better method would be to guess the middle number, thus reducing the length of possible numbers by roughly half each time. If the list of possible numbers is even, the middle value would be a decimal. However, that would be a “wasted” guess, since the user’s number is an integer. So instead, I will round down to the next lowest integer.

With each new piece of information from the user, the list of possible numbers is shortened until the user-selected number can be determined.

Step 2 – Plan Out the Control Flow

This problem is a great candidate for a while loop because the list of possible numbers is shortened with each iteration and I want the code block to execute until the list is short enough for the number to be determined.

I also know that I need a way to check for cheating. In order to do this, I decided that I would create a dictionary to keep track of each round, the user’s input (<, > or =) and the current range that the number is in.

Finally, I considered what code would need to be reused and could be placed within a nested function. I decided to make a function check_answer() that would verify a solution and also call out any cheating.

Step 3 – Write the Code

First, I created the function with a default minimum of 1 and maximum of 100. I created a list of possible numbers that spanned the given range and initialized a counter to keep track of how many iterations occur and an empty dictionary to hold the results of each iteration. Finally, I printed an invitation to the game.

def guessing_game(n_min = 1, n_max = 100):

possible_nums = list(range(1,101))
counter = 0
rounds = {}

print(f"Let's play a guessing game! Think of a number between {n_min} and {n_max}, inclusive.\n")

Next, I built the while loop that would guess a number, record and analyze the user’s response and create a new list of possible numbers. The loop is set to run as long as the list of possible numbers is greater than 1, because at that point, the user’s number can be determined.

On each iteration, the index of the middle number (or the middle number rounded down to the nearest integer is found using floor division. The number to be guessed is accessed using the index with the list of possible numbers. Also, the counter is incremented by one since a round is occurring.

Then, the user is asked how the guessed number relates to their number and their input is stored in the variable result. This result is then checked along with the length of the list. If the list still has a length greater than 3, a new list is created. Otherwise, there is enough information to call the nested function answer_check().

Finally, the dictionary is updated with the current value of the counter as the key and a tuple of (result, smallest possible number, largest possible number).

while len(possible_nums) > 1: 
    index = len(possible_nums)//2
    guess_num = possible_nums[index]
    counter += 1
    result = input(f'Is your number <, > or = {guess_num}?')

    if result == '=':
        return answer_check(guess_num)

    elif result == '<' and len(possible_nums)> 3:
        possible_nums = possible_nums[:index]
    elif result == '<' and len(possible_nums)<= 3:
        return answer_check(possible_nums[0])

    elif result == '>' and len(possible_nums)> 3:
        possible_nums = possible_nums[index+1:]
    else:
        return answer_check(possible_nums[-1])

    rounds[counter] = (result, guess_num, possible_nums[0], possible_nums[-1])

Once I was happy with the while loop, I created the function to check the answer and look for cheating. First, the user is asked if their number matches the guessed number and this is stored in the variable check.

If they respond in the affirmative, a confirmation message is printed. If they say “No,” the dictionary is updated once more to capture the final iteration and a for loop prints the results of each round, thus calling out the cheater.

def answer_check(number):

check = input(f"\n Is your number {number}? (Y/N) \n")    


    if check == 'Y':
        return(f"Excellent! I guessed your number in {counter} tries.")

    else:
        if result == '<':
            rounds[counter] = (result, guess_num, possible_nums[0], guess_num)

        else:
            rounds[counter] = (result, guess_num, guess_num, possible_nums[-1])

        print("Something's fishy here.")
        for key,value in rounds.items():
            print( f"On round {key}, you said your number was {value[0]} {value[1]}.")
            print(f"This means your number is between {value[2]} and {value[3]}.\n")

Step 4 – Consider Edge Cases

Any time a user is asked to provide input, it is possible that they enter something other than what they are asked. I added in checks for this.

The final game looks like this:

def guessing_game(n_min=1, n_max=100):
    
    possible_nums = list(range(1,101))
    counter = 0
    rounds = {}
    
    print(f"Let's play a guessing game! Think of a number between {n_min} and {n_max}, inclusive.\n")
    
    def answer_check(number):
        check = input(f"\nIs your number {number}? (Y/N)\n")
        
        if check not in 'Y,N':
            print("I'm sorry. I do not understand your answer.")
            check = input(f"\nIs your number {number}? (Y/N)\n")
            
        if check == 'Y':
            return(f"Excellent! I guessed your number in {counter} tries.")
        else:
            if result == '<':
                rounds[counter] = (result, guess_num, possible_nums[0], guess_num)
            else:
                rounds[counter] = (result, guess_num, guess_num, possible_nums[-1])
            print("Something's fishy here.")
            for key,value in rounds.items():
                print( f"On round {key}, you said your number was {value[0]} {value[1]}.")
                print(f"This means your number is between {value[2]} and {value[3]}.\n")
    
        
        
    
    while len(possible_nums) > 1:

        index = len(possible_nums)//2
        guess_num = possible_nums[index]
        counter += 1
        result = input(f'Is your number <, > or = {guess_num}?')
        
        if result not in "<,>,=":
            print("I'm sorry. I do not understand your answer.")
            result = input(f'Is your number <, > or = {guess_num}?')
        
        if result == '=':
            return answer_check(guess_num)
        
        elif result == '<' and len(possible_nums)> 3:
            possible_nums = possible_nums[:index]
        elif result == '<' and len(possible_nums)<= 3:
            return answer_check(possible_nums[0])
        
        elif result == '>' and len(possible_nums)> 3:
            possible_nums = possible_nums[index+1:]
        else:
            return answer_check(possible_nums[-1])

        rounds[counter] = (result, guess_num, possible_nums[0], possible_nums[-1])

And here is an example of the output:

Let's play a guessing game! Think of a number between 1 and 100, inclusive.

Is your number <, > or = 51?>
Is your number <, > or = 76?<
Is your number <, > or = 64?>
Is your number <, > or = 70?>
Is your number <, > or = 73?<
Is your number <, > or = 72?<

Is your number 71? (Y/N)
Y

Out[124]:

'Excellent! I guessed your number in 6 tries.'



And an example of cheating:

Let's play a guessing game! Think of a number between 1 and 100, inclusive.

Is your number <, > or = 51?>
Is your number <, > or = 76?<
Is your number <, > or = 64?<
Is your number <, > or = 58?<
Is your number <, > or = 55?>
Is your number <, > or = 57?<

Is your number 56? (Y/N)
N
Something's fishy here.
On round 1, you said your number was > 51.
This means your number is between 52 and 100.

On round 2, you said your number was < 76.
This means your number is between 52 and 75.

On round 3, you said your number was < 64.
This means your number is between 52 and 63.

On round 4, you said your number was < 58.
This means your number is between 52 and 57.

On round 5, you said your number was > 55.
This means your number is between 56 and 57.

On round 6, you said your number was < 57.
This means your number is between 56 and 57.

Step 5 – Refine the Code

After feedback from my instructor that I didn’t actually need to build the full lists of possible numbers (duh!), I refined my code to only consider the minimum value, the middle value (number to be guessed) and the maximum value.

def guessing_game(n_min=1, n_max=100):
    
    n_min = n_min 
    n_max = n_max
    #We start with the given min and max values.
    counter = 0
    rounds = {}
    guess_num = (n_min + n_max)//2
    #Again, floor division is used to round down to the nearest integer.
    
    print(f"Let's play a guessing game! Think of a number between {n_min} and {n_max}, inclusive.\n")
    
    def answer_check(number):
        check = input(f"\nIs your number {number}? (Y/N)\n")
        
        #verify valid input
        if check not in 'Y,N':
            print("I'm sorry. I do not understand your answer.")
            check = input(f"\nIs your number {number}? (Y/N)\n")
            
        elif check == 'Y':
            return(f"Excellent! I guessed your number in {counter} tries.")
        
        else:
            if result == '<':
                rounds[counter] = (result, guess_num, n_min, guess_num)
            else:
                rounds[counter] = (result, guess_num, guess_num, n_max)
            print("Something's fishy here.")
            for key,value in rounds.items():
                print( f"On round {key}, you said your number was {value[0]} {value[1]}.")
                print(f"This means your number is between {value[2]} and {value[3]}.\n")
                
    
    # If the guessed number is equal to either the min or max, the loop can stop.
    while n_min != guess_num or n_max != guess_num:
    
    
        #recalculate the middle number
        guess_num = (n_min + n_max)//2
        counter += 1
        result = input(f'Is your number <, > or = {guess_num}?')
        
        #verify valid input
        if result not in "<,>,=":
            print("I'm sorry. I do not understand your answer.")
            result = input(f'Is your number <, > or = {guess_num}?')

        
        if result == '=':
            return answer_check(guess_num)
        
        #if the difference between the min and max is 2, the answer can be verified.
        elif result == '<' and n_max - n_min == 2:
            return answer_check(n_min)
        
        #change the max number to one less than the guess
        elif result == '<':
            n_max = guess_num - 1
           
        elif result == '>' and n_max - n_min == 2:
            return answer_check(n_max)
        else:
            n_min = guess_num + 1

        rounds[counter] = (result, guess_num, n_min, n_max) 

        
    return answer_check(guess_num)

Lesson of the Day

I learned that in Seaborn, you can add _r to a color palette to reverse the order the colors are applied.

Frustration of the Day

My course has some html and CSS content to help us with webscraping. I really do not enjoy coding in these languages. I will NOT be putting any web designers out of a job! 🙂

Win of the Day

I finally got over my fear and wrote my first technical post! It definitely felt a little strange to write and I know that I will improve with repetition. Practice is funny that way:)

Current Standing on the Imposter Syndrome Scale

3/5

Combating Imposter Syndrome

It’s not who you are that holds you back, it’s who you think you’re not.

Hanoch McCarty

On day 4 of data science bootcamp, I had a bit of a panic attack when I woke up with the overwhelming feeling of not feeling prepared for the job interview process.

On day 4.

Even while feeling powerless to stop my panic spiral, I was fully aware of the absurdity of my fear. Of course I’m not ready to interview – I’m less than 5% of the way through this process and just now at the point where I am spending more than a few hours a week studying these concepts. The fact that I’m ill-prepared in this moment is absolutely not an indication that I’ll be ill-prepared in 5 months.

In fact, the feeling that I’m not good enough may be a key ingredient in my becoming good enough. Because even though dealing with imposter syndrome is no fun, it can also be a bit of a superpower.

After my little freak-out, I’ve intentionally put some things in place to help combat imposter syndrome –

Track Daily Progress

The daily planner that I use has a little section at the bottom of the page for gratitude. Since I have a separate gratitude journal, I decided to put this area to a different use by taking a moment at the end of the day and recording something that I have learned that day. Then, since my brain is a stubborn beast, I also decided to preface my note with the following each day:

I’m not expected to know everything.

I know more than I did yesterday.

I’ll know tomorrow than I do today.

This daily practice has a few benefits. First, it helps to shift the brain from the internal narrative of not being good enough to seeing the actual facts. It provides a record of progress that you can review and see tangible evidence of growth. And finally, the repetition of the preceding sentences acts a reminder of the nature of the learning process.

Narrow Your Focus

The more I learn, the more aware I am of how much there is to learn. And that can become overwhelming as the “must study” list soon becomes unwieldy. I spend a few moments yesterday adding some structure into my study that falls outside of the bootcamp curriculum materials.

First, I decided on three areas (Python, SQL, data visualizations) where I need regular practice both to refine my skills and to keep those skills fresh as the curriculum moves on to other areas. Next, I determined how I would address each of these – CodeWars for Python, HackerRank for SQL and Seaborn data sets for data visualization – and made sure that each of those were ready to use. Finally, I created a schedule for myself, with 30 minutes allocated for each practice session. Mondays and Thursdays are dedicated to Python, Wednesday is set aside for SQL and data visualization practice will happen on Tuesdays and Fridays.

As I improve and also encounter more areas where drill may be helpful, I can modify both the topics and the frequency of these.

A narrow focus each day provides the opportunity for targeted and regular practice, both of which will lead to greater mastery and a greater sense of mastery than being more reactive or random with any practice.

Find Mentors

Realizing that you’re not alone in your experiences is such a powerful motivator. Take the time and effort to find others that have been where you are. It is so validating to hear that not only did they experience feelings of being an imposter when they were at your stage, they probably still have those feelings even though, from your perspective, they are far from faking it.

There is one block that many people experience when it comes to finding mentors – in order to benefit from the relationship, you have to be willing to be vulnerable. For many of us, this is a struggle. We’re taught to never show weakness, to pretend that we’re confident at all times. And certainly, there are times when it is appropriate to fake it, but if we’re always hiding, we’ll always feel like a fraud.

Share What You’re Learning

There really is truth to the idea that we learn best by teaching others. When we speak or write about what we’re learning, it both allows us to gain a deeper understanding and builds our confidence as we either refine our knowledge or even take on the role of an expert (after all, when you’re speaking to someone who knows nothing about what you’re learning, you ARE the expert).

I’m very aware that I am currently at a place where I can do more with data science than I feel comfortable taking about. There’s a fear that if I say too much, my ignorance will be revealed. Yet the way to combat that is not by staying silent, but by becoming comfortable taking through my thought processes. I’ve been avoiding writing more technical posts, with thoughts of, “This is so simple, why would anyone want to read this?” or “People are going to think I’m so stupid” going through my head. But then I realize that it wasn’t so simple to me just a short time ago. So, stay tuned for more technical content soon:)

Take Breaks

Pushing all the time doesn’t make you better, it makes you tired. None of us are at our best when we’re exhausted, as both cognitive skills and the ability to handle stress are decreased. Yet, when we’re feeling like we’re not good enough, it can become easy to keep pushing no matter what. Yet, even though breaks can feel like wasted time, they are actually critical to the growth process.

Athletes are familiar with the concept of overtraining. When they spend too much time exercising and not enough time resting, the body rebels and strength and speed gains are actually reversed. Cognitive training is no different. Breaks are just as important as work.

End Each Day on an High Note

Yesterday tried to end on a frustrating note for me. I wanted to complete a module on NoSQL, but I was hitting a wall in the installation of MongoDB (and this after riding a high over the SQL material). I could tell that I didn’t have much left in me and that it was time to step away from the computer. Although I was tempted to simply shut down and walk away, I knew that if I ended the day on a “failure,” it would feed into my insecurities overnight.

So instead, I logged into HackerRank and did half a dozen SQL problems, thus ending the day with a feeling of success. And then, before completely stepping away, I wrote down what I learned with my reminder that I’ll know even more tomorrow.

Psychology talks about the peak-end effect. When we remember an event, we are the most focused on the “peak” of it (which is the most positive – or most negative – part of the experience) and the end. By orchestrating the end of each day, we can literally alter how we feel about the entirety of the day.

Recognize the Benefits of Imposter Syndrome

There’s a reason that many of the world’s most accomplished people admit to dealing with imposter syndrome – that feeling of not being good enough is what propels them to work hard and to achieve. This feeling you have right now may not be pleasant, but it may just be the fuel that allows you to do great things.

Lesson of the Day

I had worked with SQL and Python independently in the past. I finally learned how the two can work together. It’s interesting blending two prior skills into one. Now, to keep the syntax straight:)

Frustration of the Day

Installing MongoDB 😦 And really, just the command line in general. I feel like I’m just typing in some sort of spell from Harry Potter and crossing my fingers for the desired outcome.

Win of the Day

I did four SQL interview questions that were released from Amazon and Google. Two were really easy, one I made a silly mistake because I didn’t read carefully enough (but I totally get the concept) and only one was rough enough that I couldn’t completely get it. Whew.

Current Standing on the Imposter Syndrome Scale

4/5

I’m feeling it today.

Reflections From the First Day of Data Science Bootcamp

My brain is experiencing technical difficulties. Please stand by.

After two years of making preparations, today is (finally!) my official first day of data science bootcamp.

And for those of you considering doing something similar or those of you thinking that I’m bonkers for leaving a known thing, I know what you’re thinking:

So, how did it go?

The Curriculum

Phase 1 of the curriculum was pushed out to my cohort last Friday. This phase has about three weeks of learning the material and then another week to work on a summative project that utilizes the skills. The material consists of lessons and labs in Jupyter notebook as well as videos that go over key concepts.

Phase 1 includes setting up your environment (which I’ve kind of muddled through before, so it was nice to have more direction), GitHub (currently my nemesis), data manipulation and analysis in Python, working with CSV and JSON files, Pandas, matplotlib, SQL, APIs and web scraping. Needless to say, that’s a LOT of content for 3 weeks!

I am SO glad that I did the self-paced courses through Codecademy and DataQuest, as there is a good amount of overlap in the concepts covered. I know that I would have been VERY intimidated by the outline of the material in Phase 1 if I did not have some prior exposure to it. I know that I do best with difficult information when it has some time to marinate and I continually circle back to concepts. This prep work is really paying off because I’m not trying to learn every little thing all at once.

The Pace

There’s no way to sugarcoat it; the pace in a bootcamp is intense! We are told to expect around 50 hours a week, and that seems to be about right. My program has live virtual study sessions Monday-Thursday afternoons. My general plan is to make sure to have all of the lessons associated with the session completed ahead of time so that I can ask questions, learn from different approaches to the problem and use the session as review.

The People

It feels SO good to no longer be on my own little data science island! I love my cohort lead (he’s seriously geeked up about data science!) and we even have a community lead who helps us with the non-technical part of this journey (like how not to panic when you feel stupid). They are super approachable and between Slack and weekly 1:1 sessions, I feel like I’ll have the support I need.

Tomorrow, I get to “meet” the other students in my cohort. It’s going to an interesting adjustment. I’ve spent 20 years working with teachers, which are generally extroverted females. Tech tends to lead more introverted (which I am!) and male (which I’m not!). I’m excited to see how our different experiences and perspectives meld together.

The Tools to Help With Sanity

Knowing that it’s easy to get chair-locked doing intense computer work, I downloaded an app to remind me to take breaks. It is set for a 15-second break every 15 minutes. During that time, I make sure to stand up and change my focus to something further away. I usually visit with the dogs for a few moments or get a couple stretches in. Then, it reminds me to take a 10-minute break every hour. I try to get outside during this time. These breaks have helped my body AND brain handle the day better.

I’m also pretty sure I’m going to be in the best shape of my life by the end of this. When I’m stuck on a problem or just need a change of pace, my go-to is movement. I plan to incorporate a mixture of hiking on a local trail, kettle bells and yoga. All that exercise is a perfect complement to the cognitive work.

And finally, above my desk I have a canvas that my mom sent with the message, “You got this.” It never hurts to have some inspiration around:)

The Overall Experience

It feels SO good to be learning! Although the thought of being on the receiving end of grading again will take some getting used to:) As of today, I am very glad I am taking this risk and I am so excited to see where this path leads me.

And for now, I’m off to something non-thinky. My brain hurts!

Lesson of the Day

I did a little practice working with some pretty complex (at least to me) JSON schemas. I’ve definitely gotten much better at accessing nested data; I remember when that used to completely stump me (and now it only partially stumps me).

Frustration of the Day

Having a cold:(

I just feel plain lousy and draggy.

At the same time, I’m SO grateful to just be moaning about a simple cold. It could be SO much worse!

Win of the Day

My goal was to get a little bit of a head start since I will be out of town two weekends in July. Somehow, “a little bit” turned into completing about ⅓ of Phase 1 (3 weeks of material) by the end of day 1. Oops. Now, I need to make sure that this “win” doesn’t become a “lose” if I burn myself out.

Current Standing on the Imposter Syndrome Scale

3/5

Why I Decided to Learn Data Science

“The goal is to turn data into information, and information into insight.”

– Carly Fiorina

I didn’t find data science. Data science found me.

After 18 years of teaching math, I knew that I needed a change. I was restless and unchallenged even while I was winning awards and creating programs. Looking for my next move, I kept browsing job descriptions and talking to friends and family in various careers.

But nothing clicked. Each option felt more like I was running away from teaching rather than running towards something that I was passionate about. All of that changed one Saturday morning, when an ad for a data science bootcamp appeared on my Facebook feed. Curious, I clicked on the link.

Math? Check.

Creativity? Check.

Communication? Check.

Interesting problems? Check.

Within minutes, I was reading blogs about data science, exploring data visualizations and learning about the seemingly endless applications. I was hooked. Now, THIS was something that I could run towards!

Why do I love data science?

Let me count the ways-

1 – I’m naturally curious and I love to ask questions.

Whenever I learn a new fact or observe something interesting, my first inclination is to ask, “Why?”. My favorite movies, podcasts and books are those that expose me to new information and provide opportunities for further research.

2 – I get a thrill when data refutes assumptions.

Reading Freakonomics changed how I view the world. I found it utterly fascinating how something can “feel” so true, yet the data tell a different story. It taught me to always be a critical consumer of data and to never be so wedded to my beliefs that I refused to have my mind changed.

3 – Messy problems excite me.

Ideas that fit firmly into one category or another are not interesting to me. I enjoy messy problems, with more time spent in the gray area of uncertainty than in absolutes.

4 – I enjoy taking complex ideas and finding a way to communicate them in understandable terms.

Whether in my career as a math teacher or my side work as an expert writing and speaking about divorce, I love to take complex and abstract ideas and use visualizations, analogies and examples to help others find understanding.

5 – I am fascinated with psychology and why we act the way we do (even when the data advise something different).

I am fascinated with cognitive biases and how much they impact what we do. In my work with both students and divorcees, I’ve learned how to anticipate and work with human behavior.

6 – I love to solve problems and find patterns.

The process of trying different approaches, working through the frustration of roadblocks and finding connections excites me. There is nothing like the feeling of persevering on a difficult problem until you land on a solution.

7 – I’m interested in the intersection of social sciences and data science, as the ethics of big data become paramount.

Unintended consequences are still consequences. The data don’t exist in a vacuum and it is critical to consider it in a broader context.

8 – In everything that I do, I seek to be helpful to others.

I want my work to have purpose, to solve some sort of problem that will be of benefit to others. Data science has so many practical applications that provide real value to so many.

9 – I enjoy working on teams comprised of people with different perspectives.

Data science is inherently interdisciplinary. My favorite teams are heterogenous, filled with different areas of expertise. The best ideas and solutions come from diverse experiences.

10 – I am at my happiest when I am learning something new.

This is what drove me out of teaching and what pulled me into data science. I see myself as a perpetual student, and the endless opportunities and brilliant minds within data science mean that I will always have something to grow towards.

I see the application of data as both an art and a science. Obviously, you need the technical and mathematical know-how to collect, wrangle and analyze the data and to build models. But there’s more to it than that. The art is looking at data like a sculptor looks at a slab of marble, cutting away the noise and finding the beauty within. What stories might this data reveal? Even though this model is functional, is it useful? Am I allowing my conclusions to adapt as new information comes in?

Data is messy, overwhelming and often misleading. Yet, it the right hands, it can also be used to understand and interact with the world. I look forward to being one of those hands.

Lesson of the Day

I’ve been avoiding GitHub so far because it intimidates me. Guess the first module in my bootcamp? It’s time for me to get Git. So far, I have it successfully installed. Baby steps:)

Frustration of the Day

I’m having to spend time setting up my environment before I can get into the “good” stuff of bootcamp. I’m having a difficult time not jumping straight into Pandas!

Win of the Day

There is very little in “Phase 1” of my bootcamp program that I haven’t had at least some exposure to. Thank you Lisa of the past for doing so much pre-study!

Current Standing on the Imposter Syndrome Scale

3/5

12 Strategies I Used to Prepare for Data Science Bootcamp

1 – Ask Questions

From “Is data science a good fit for me?” to “Why is this parameter being used in this machine learning algorithm?,” my entire process has been driven by questions. Not only does this approach help to maximize learning, it’s also good training for working with data, where reaching conclusions too quickly is a temptation to be avoided.

I’ve always been curious and had a tendency to ask questions about the world around me, but now I am more conscious about generating questions as I read articles, listen to podcasts or hear a claim on social media. In my mind, data is now cheap, but its quality is largely determined by how well we ask questions about it. I think it’s easy to see data science as writing lines of code or creating a sexy machine learning model to make impressive-sounding predictions, but at its heart it is about forming and testing hypotheses, which all starts with asking questions.

2 – Start Early and Do a Little Each Week

I made the decision to transition into data science a full year and a half before I was able to begin a program. In the beginning, I was frustrated by this delay (which was dictated by my need to save up enough money for the program and to live on for several months). Yet in hindsight, I am grateful for the protracted period before the official start date because it gave me so much time to prepare.

In my case, I had no programming background and, although I was a math teacher, I definitely needed a refresher on some of the necessary concepts. I created goals for myself to work on over the 18 months:

  • learn Python
  • become familiar with SQL
  • review statistics and calculus and get over my fear of linear algebra
  • gain exposure to machine learning algorithms
  • play around with R

This is not material that you can cram into your brain and expect to retain or fully comprehend. I found that spending a little time each week (sometimes as little as an hour and other times putting in several hours a day), I was able to absorb and remember the material so much better.

All of that preparation made the bootcamp pre-work and assessment quite straightforward. I know that I will have plenty of opportunities to be overwhelmed later; I’m glad that I don’t feel that way yet.

3 – Complete Self-Paced Programs

Part of this process is learning how you learn best. I quickly discovered that when it comes to coding, I do best with self-paced programs that have minimal video and contain scaffolded exercises and labs to progress through a data science curriculum.

I began with Codecademy’s free content and then quickly purchased a year’s worth of access. I found it extremely valuable and very accessible to someone new to coding. Once I worked through all of their material, I purchased DataQuest’s program. I’m glad I did this one second, as it is more rigorous than Codecademy.

Altogether, I spent around $500 and several hundred hours on these two programs. Based on what I’ve gotten out of them, that was a very worthy investment.

4 – Engage With Recommended Resources (IF They Work for You)

On top of the two programs I mentioned, I also asked the admissions counselor at my bootcamp program for the resources that their instructors recommended. These largely consisted of free Udacity courses and a couple YouTube channels. These came in handy when I was completing the official pre-work, as it aligned well with the course material.

Some of the suggested resources worked well for me. Others did not. There was one particular course that I kept trying to work my way through, but I kept hitting a wall on every attempt. Before admitting that the material was too difficult for me, I considered that maybe it was just the wrong delivery. I did some hunting around until I found a comparable program with a different presentation and those walls soon fell away.

Remember that the instructors want you to be successful. They are an invaluable resource when it comes to wading through the seemingly endless information that is available. Yet ultimately this is about YOUR learning. Use what works for you.

5 – Be Mindful of Impact of Information

When I made the decision to transition into data science, I sought out relevant communities on Twitter. As I read their Tweets, didn’t take long for me to start doubting myself. These people were super-smart, like “I’m struggling to understand 10% of what you’re saying” smart. “Is this where I’m expected to be,” I wondered, because I’m far from that.

Finally, it dawned on me. I’m following these folks because they were the first ones that popped on when I entered relevant search terms. They were the first ones that popped up because they are the top voices in the field. No wonder they’re uber-smart! I don’t need to worry about comparing myself to them; there is a lot of space between unsuccessful and top of the heap. Aim there:)

Another area to be wary of is the responses and comments on Stack Overflow, CodeWars, etc. While many people are there to learn and to help others learn, some are there simply feed their own egos by putting others down. Those folks are not worth your energy or attention.

On the other side, it’s important to have your cheerleaders. Make sure you know who supports you and that you look to them when you’re feeling especially defeated.

6 – Use Repetition to Create Automaticity

After teaching math for 20 years, I’ve learned the value in having students be able to attend to more rote tasks (like solving equations) automatically in order to free up their thinking for more complex applications. I decided to apply this same reasoning to my study, with the aim of making some coding tasks almost automatic. I found three ways to make this happen:

  • I downloaded a variety of free apps on my phone that are designed to learn and practice Python. Because these are phone-based, they rarely require typing code, but the multiple-choice and drag and drop exercises helped to drill syntax and also aided in proof-reading code.
  • I used various short coding challenges (mainly Edabit and CodeWars). These are not only excellent for working on problem-solving, they also end up using some of the same basic code blocks over and over again, which means that tasks like writing a function or using control flow become second nature.
  • After completing the Codecademy and DataQuest courses, I deleted my first attempt at the labs and redid those exercises. By doing them a second (and sometimes even a third) time, I improved my code and my efficiency at writing it.

7 – Focus on Fundamentals

It’s easy to get caught up in the allure of self-driving cars, sophisticated recommendation engines or seemingly magical classification programs. Data science definitely has an exciting and cutting-edge component that is inherently seductive.

But while those applications are wonderful to read about, it’s not the place to begin. Start by focusing on mastering the fundamentals. Once you know the building blocks, then you will be able to apply them in novel and interesting ways.

8 – Document Progress

It’s difficult to see growth when you’re in the middle of it. I didn’t realize how much progress I had made until I redid a lab that once took me 6 hours and a major headache in 20 minutes without much thought a mere two months later. Make sure that you have some way to document and see your progress; it becomes invaluable when you need a reminder that you ARE learning.

9 – Play Around With Data

Once you start your program, you will have to be task-oriented when it comes to data as you’re working towards certain goals. Before you begin, take some time just to play around with various training data sets (I like the ones in the Seaborne library because they are pre-cleaned and beginner friendly). Try adding new columns to the DataFrame based on previous columns, create a variety of displays and see what information they tell you and try out some of the machine learning algorithms from scikit-learn. When your only goal is to see what you can discover, you end up learning some pretty neat things,

10 – Use Good Habits From the Start

Learning anything, but especially highly technical and complicated information, is hard and mental roadblocks – and the inevitable frustration – are pretty much a guarantee. I have found that the best way for me to handle this is to step away from the computer and engage in something that uses the body while allowing the mind to wander. You don’t need to be at your desk in order to work through a problem.

It didn’t take me long to realize that, when it comes to writing code, Google (and more specifically, Stack Overflow) is your friend. It can be tempting to simply copy and paste the necessary code into your workflow and move on with your day. Yet this is pretty much the equivalent of copying your friend’s math homework – you may save some time and cognitive stress now, but when it comes time to do it yourself, you find that you don’t quite know how.

I created some ground rules for myself when it comes to Googling code:

  • If I don’t understand the code, I cannot use it unless I first do the work to understand every single line.
  • Before I use the code, I talk myself through it, explaining what every component is doing.
  • When applicable, I look at just enough to get unstuck and then come up with my own approach that I eventually check against the published code.
  • If I understand the code and make the decision to use it, I retype it instead of copying and pasting. This is especially helpful when you’re trying to memorize syntax.
  • If it is something I have looked up more than once, I make sure to include it in my notes.

11 – Develop a Note-Taking Strategy

When I first started studying, I purchased several notebooks and designated each one for a different topic (Python, SQL, statistics, etc.). This was effective for writing down information, but even with designated notebooks and tabs, it became difficult to look up information that I had previously recorded.

Then, thanks to Covid and underfunded teacher budgets, I ended up purchasing an iPad to teach my virtual math classes. I played around with some different note-taking apps and settled on GoodNotes (with an additional template that I purchased though Etsy). It has been absolutely life-changing. Not only is it easy to organize and take notes (including links and images), the search feature means that I can actually find what I have written.

Take some time before you begin your program to settle on a note-taking strategy that works for you and have it at least partially organized ahead of time so that you have a place to put all of the information that you’ll be receiving.

12 – Teach Others

You may not know much yet, but you still know more than somebody else and the best way to get better is to teach another. I found a way to work some basic data science concepts into my algebra classes, talked through a machine learning algorithm with my husband and answered some questions on discussion boards. Through each of these experiences, I helped someone learn while solidifying my own understanding.

Lesson of the Day

Not much to report here. I just returned from a much-needed vacation. So, I guess the lesson is to take a break sometimes.

Frustration of the Day

I read an article about AI being used to detect human emotion. I worry that in trying to distill emotions into categories, we’re losing critical nuance. Technology grows faster than our understanding of how best to apply it.

Win of the Day

This may seem like such a small thing, but I’m starting to talk about my teaching career in the past tense!

Current Standing on the Imposter Syndrome Scale

3/5

10 Things I Will Miss About Teaching (and 10 Things I Won’t)

“Sometimes you will never know the true value of a moment until it becomes a memory.”

Dr. Seuss

What I Will Miss

1 – Watching a student find their passion and begin to believe in themselves.

2 – The excitement that happens when a student perseveres and then finally “gets it.”

3 – Those moments when the students make connections with what they know and figure out a new concept on their own.

4 – Listening to students teach each other, especially when the “teacher” is one who used to struggle.

5 – The opportunities to play and be silly with the kids.

6 – The inside jokes and classroom catch phrases that have been passed down through the years via friends and siblings.

7 – The challenge of creating fun – and difficult – application tasks that blend higher math with middle school sensibilities.

8 – The knowledge that what I do every day makes a difference.

9 – The opportunity to help the students achieve more than they ever thought possible.

10 – The kids.

What I Won’t Miss

1 – Grading.

2 – Bus duty, car duty, morning cafe duty, hall duty…

3 – Endless hours at the copy machine (especially those that are frequent jammers).

4 – Curriculum that gets revised at least every election cycle just to make it different, not to make it better.

5 – Worrying about the kids all of the time and either feeling helpless or frustrated about my locus of control.

6 – Planning lessons in my sleep and then waking up in a panic that I don’t have the materials ready for my dreamed-about lesson.

7 – The lack of time to handle my basic physical needs.

8 – Lockdown drills.

9 – Standardized testing and seeing the stress it puts on the kids.

10 – The feeling of stagnation.

Lesson of the Day

I was worried that my SQL knowledge had disappeared, so I went through a 4-hour tutorial, where I knew everything in it. In the comments, many mentioned that this tutorial landed them a job. So, at least one of the following is true: 1) I know more than I think I do, 2) There are a lot of people in jobs with a minimum of knowledge, 3) People lie in YouTube comments:)

Frustration of the Day

I am struggling not to go into “countdown mode” with school. I need to stay present and appreciate these last few weeks.

Win of the Day

I had a student tell me that she’s proud of me after I told her about my career change!

Current Standing on the Imposter Syndrome Scale

3/5

4 Signs That It’s Time to Make a Change

The secret of change is to focus all of your energy, not on fighting the old, but on building the new.

Dan Millman

Change is hard.

And so, like with many things that are hard, we often do our best to avoid it.

Sometimes, we are left with no choice. After all, when the house is on fire, there’s nothing to do but run out out the door.

But instead, if that house is just a little too confining or the wrong layout or misplaced for our needs, we’ll engage in all sorts of mental gymnastics to avoid making a change.

And of course, this doesn’t just apply to homes. It’s true when it comes to careers, to appearances, to habits and to relationships. When we’re not quite content, but there is a lack of an urgent need to change course, we’re in a state of limbo.

“I’m fine where I am,” you say.

I don’t feel at peace with myself,” you think.

“I’ve been doing this for years, why change now?” you say.

If I don’t make a change now, I never will,” you think.

“At least this is a known entity. The alternatives could be worse,” you say.

But I won’t know unless I try,” you think.

“I could fail,” you say.

I am stagnating,” you think.

There are no clear and consistent signs that deciding to make a change is the right choice.

Yet there are four indications that the challenge of change is preferable to the temporary comfort of staying put:

There Are No More Variables Left to Change in the Current Situation

I am going to continue with the house analogy here, because it make this easy to understand. If you’re unhappy with your home, it makes sense to first paint the walls and install a new area rug. If that doesn’t improve your feelings towards the house, maybe next you invest in a more substantial remodel. Yet at some point, if you’ve addressed all of the logical variables that can be modified and you’re still not satisfied, it’s time to move on.

Staying With the Status Quo Has Begun to Feel Like a Grind

There are always times in life when we have to put our heads down and simply push through to get through. Yet all of life shouldn’t feel like mile 60 in a 100-mile race. We are creatures of inertia; we’re very good at doing what we’ve done and less skilled at changing direction. Yet maybe that is exactly what needs to happen if the groove carved by trudging the same path feels like you’re digging your own grave.

You Approach the Thought of Change With Both Excitement and Fear

Not only is change hard, it is scary. It requires a leap of faith as you leave behind the implied security of the known terrain. It asks you to meet new challenges before you’ve proven yourself. Yet at the same time, change can be exciting, as all new and interesting things are. When fear and excitement are playing a fairly-matched game of tug-of-war in your mind, it’s a solid indication that you’re going the right way.

There is a Feeling of Lightness When You Make a Move Towards Change

When we’re in the wrong situation, it weighs on us. Pulls us down. If you make a decision towards change and feel relief (even if you’re still having doubts), that’s quite telling.

Change may be hard, but that’s no reason to avoid it.

After all, everything worthwhile in life takes effort.

Make sure your efforts are aligned with your goals.

Lesson of the Day

I have money saved to both pay for bootcamp and to support myself during bootcamp, but I’m finding that I’m slipping into a scarcity mindset. I need to trust myself.

Frustration of the Day

I have had a difficult time motivating myself to study this week and an even more difficult time being kind to myself about it.

Win of the Day

In 20 years of teaching math, I’ve been through a dozen curriculum overhauls. There’s another one next year. I am SO grateful that I don’t have to go through that again!

Current Standing on the Imposter Syndrome Scale

3/5

The Power in Having a Beginner’s Mindset

“In the beginner’s mind there are many possibilities, but in the expert’s there are few”

― Shunryu Suzuki

When my phone buzzed for the fifth time yesterday with another teacher asking for advice and guidance, my initial irritation at being interrupted soon turned into a moment of nostalgia. In a few weeks, I will no longer be the “expert” and instead will be the one asking the questions.

It’s scary leaving what you know, voluntarily replacing the security of confidence with the uncertainty of a blank slate. Scary, yet also exciting. Because as adults, we don’t often get – or allow ourselves – to spend time in a beginner’s space. We know what we’re good at and so we stay there. Comfortable. And also confined.

There is magic that happens when we allow ourselves to be beginners again.

Beginners are receptive to input.

When I attend professional development as a teacher, I listen with half an ear. After twenty years of informal experimentation in my classroom and reading the latest research, I know what works for my students. When new ideas are suggested, it’s easy to dismiss them as something already tried and discarded or as ineffectual.

It’s a world away from my approach when I first started teaching when I would voluntarily spend my planning period observing other teachers and would seek out the masters in the craft to ask their advice. I was a sponge, constantly questioning and also open to anything.

With a beginner’s mindset, ego and expertise are washed away. It’s a window where you’re receptive instead of defensive, making space for the wisdom of others as you begin to construct your own understanding.

Beginners have the flexibility to seek creative solutions.

Beginners don’t know the “right” way, so they have the freedom to explore a “new” way. I see this in action in my classroom all the time when I give students a type of algebra problem with no guidance in how to approach it. Within minutes, each group will have a unique approach, some of which I have never thought of. The resulting discussion is much richer than if I had simply shown them the most efficient method at the outset.

Beginners naturally look for connections to anchor their understanding and pathways through a problem. When we have prior knowledge in an area, there is a tendency to stay within the bounds of that knowledge, the possible routes pruned back to only the essential. But as a beginner, all options are on the table. And sometimes, one of those novel solutions contains something that was missing before.

Beginners see mistakes as opportunities rather than a threat.

If you are perceived as an expert skier, falling as you exit the lift is an embarrassment. But if you’re a nascent skier, faceplanting is simply accepted as part of the learning process (and yes, that is autobiographical).

Beginners often have an easier time separating mistakes from identity. After all, you already know you’re not yet good something, so not getting it exactly right is to be expected. Furthermore, that error is seen as a wealth of information, ready to be mined for continued improvement.

Finally, being a beginner is a powerful reminder that we ALL can benefit from having a beginner’s mindset even when we become the one others turn to for advice. After all, learning is never done.

Lesson of the Day

I had a reminder that I need to stop underestimating myself. Maybe someday I’ll heed this lesson.

Frustration of the Day

I still have three months before I begin my data science bootcamp. I want it to start tomorrow.

Win of the Day

Now that my resignation from teaching is public, the messages from coworkers, parents and former students are pouring in. It’s hard to process it all right now, but I’ve definitely made a difference.

Current Standing on the Imposter Syndrome Scale

3/5

You Can’t Have Growth Without Loss

“You can’t have growth without change and you can’t have change without loss.”

Rick Warren

I’m grieving.

Even though there is no death, even though it is a loss of my own creation, there really is no other word for it.

I’m grieving for the end of my 20-year career identity as a teacher.

Last week, I told my 7th graders that I will not be their teacher for 8th grade. For the first time, I was glad that their faces were covered with masks. I told them moments before the bell so that I only had to hold it together for a few minutes myself.

As hiring selections and plans are being made for next year, it’s strange being on the outside instead of being instrumental in the decisions. It’s like I’m a ghost in my own school.

I’m becoming very aware of all of the “lasts,” coming with ever-increasing frequency – the last time I’ll teach this lesson, the last time I make high school recommendations, the last time I create new content for the classroom and even my last teacher evaluation. Even though some of these are more-than-welcome (car rider duty, I’m looking at you!), most are bittersweet. And I haven’t even said my goodbyes yet.

I’m in a weird spot right now, a limbo where I’m very aware of what I’m leaving and yet I can’t really begin the new stage yet.

But it’s a necessary step.

Because in order to make room for the change I need and want, I have to let go.

Let go of the moments in the classroom and with the students that I have loved.

Let go of the comfort that comes with mastery.

Let go of the security that I’ve had with my career.

Let go of my identity as a teacher.

Let go of the feeling that I’m leaving everything behind; these experiences and memories will always be a part of me.

It’s spring right now in my area of the country. I have this oakleaf hydrangea in the back corner of my yard that never lost its leaves this past fall. Right now, it is covered both in old and darkened foliage that is no longer receiving any nutrients and in the fresh, small bright green buds of new growth. It is holding a on a bit longer before it sheds the old to make way for the new growth.

In a few months, we will bloom together.

Lesson of the Day

Something can be sad and also be the right thing.

Frustration of the Day

I tried starting a Kaggle competition for the first time and had trouble trying to plan an approach. My brain just can’t focus well right now.

Win of the Day

I’m seeing progress in my efficiency in solving coding problems. I saw an “evolution of a Python programmer” post and I am no longer at the beginning stages!

Current Standing on the Imposter Syndrome Scale

3/5

12 Teacher Skills That Transfer to Tech

“If you want to teach people a new way of thinking, don’t bother trying to teach them. Instead, give them a tool, the use of which will lead to new ways of thinking.”


― Richard Buckminster Fuller

Some of my most eye-opening experiences as an educator came from the years where I trained a student teacher for a semester. As they began their stint by observing my lessons and preparations in their first few days, I inevitably became overwhelmed at the sheer volume – not to mention complexity and nuance – of skills they would need to master over the next several weeks. Skills that become so ingrained in an experienced teacher that they go unnoticed and unappreciated.

And with very few exceptions (like knowing how to quickly silence a group of 35 teenagers with merely a look), those skills transfer to the world outside of the classroom.

-1-

Teachers understand and embrace the learning process.
Technology is always evolving and requires its participants to be lifelong learners.

The technology that we have today will be obsolete tomorrow. As a result, tech not only needs people that have mastered a certain tool or process, but needs people that can be continuously learning and growing. Teachers have a leg up in this arena, since they are so skilled at recognizing – and navigating – the inherent struggles that arise when learning something new. Additionally, teachers operate with a growth mindset perspective, believing that effort and practice can lead to new skills.

-2-

Teachers are experts and sequencing and chunking complex topics in order to make them more understandable.
In technology, problems are solved by breaking them down into smaller problems and tackling them in a logical order.

As a teacher, I was tasked with taking a group of students from an elementary understanding of math to a mastery of algebra within a three-year period. I was successful because I knew how to group, organize and break up concepts so that they could be understood. Those same skills are used in tech, where small chunks of code can be assembled into a larger block or in presenting technological information to a non-tech audience, where you have to be deliberate in your approach.

-3-

Teachers are adept at all forms of communication.
In technology, you have to first listen to understand the problem and then be able to effectively communication the solution.

No field thrives without quality communication both within the business and with stakeholders and/or customers outside the industry. Teachers know how to communicate. Teachers are expert listeners because before you can teach a student, who have to first understand what they know and how they think. Teachers are often effective writers, as they craft everything from directions on a lab to an article for the school website. And of course, teachers excel at presentation since they prepare and deliver these multiple times a day.

-4-

Teachers are expert storytellers, using narrative and visuals to make their content come alive.
Technology often needs people that can synthesize multiple ideas and weave them into a cohesive presentation.

Information is useless if people can’t assimilate it. Whether because of a lack of background knowledge, misconceptions or cognitive biases, it is often a challenge to get people to understand difficult or technical concepts. Teachers know how to build from prior knowledge and use storytelling to uncover and address any previously help beliefs.

-5-

Teachers are nimble in their approach, flexibly trying different solutions until they find the one that works.
Within the tech world, it is also important not to become too wedded to one methodology; a problem-solving mindset is required.

Even though there are certain concepts that I taught every year for my entire career, I never taught them in the same way because the students were not the same. Every day in the classroom provides myriad opportunities for problem-solving and resourcefulness as you have to figure out a way to make it work. Tech is no different. Even if one language or tool is your favorite, it doesn’t mean that it’s the right one for this particular job.

-6-

Teachers are skilled at starting with a longterm goal and then planning backwards what steps are needed to reach that endpoint.
Technology is often trying to solve big problems and it needs people that can strategize how to incrementally reach that solution.

Tech rarely grows in leaps and bounds, rather it uses incremental improvement to increase efficiency or usefulness over time. Teachers are used to this methodology, using repeated observations and assessments to measure progress towards a larger goal.

-7-

Teachers become masters at error analysis, tracking down and addressing the root of a problem.
In technology, at least as much time is spent identifying and fixing problems as is spent on building new systems.

Scanning through lines of code looking for the bug is very similar to reading through lines of a student’s work looking for their error. And in both cases, identifying the error is only the first step. The more important part is understanding why it occurred and how to remediate the problem.

-8-

Teachers have to become comfortable and adept at improvising when things don’t go as planned.
In technology, it is critical to be able to figure out a new path when an obstacle arises.

Whether it’s an unplanned fire drill that cuts class time down to 10 minutes or the internet going down at the beginning of a technology-focused lesson, teachers have to be good at thinking on the fly. The tech world may have fewer unplanned fire drills, but the forced deviations from a plan are just as numerous. It’s helpful to have people around that can navigate those without frustration or overwhelm.

-9-

Teachers have tremendous experience in working with diverse groups of people that often have different perspectives and experiences.
Technology brings together people from all backgrounds and the best results come from teams that can effectively work together.

Teachers know how to collaborate, working together to achieve a goal and utilizing the talents that each person brings to the table. They are comfortable in diverse groups and skilled at guiding conversations that contain many different views and ideas.

-10-

Teachers are experts at both asking and using questions.
Technology is a tool that is at its best when it arises from great questions and never refrains from questioning its conclusions.

Contrary to how many people view teachers, they actually spend more time asking rather than telling: How do you know that? Why did that happen? What would happen if…? Questions like that are critical in tech, where it is all-too-easy to adopt a narrow focus that fails to challenge itself. Questioners improve both process and product.

-11-

Teachers are used to working with constant – and rigid – deadlines.
In tech, deadlines are critical as projects move through the pipeline.

When the bell rings, the teacher HAS to be ready. As a result, teachers are used to deadlines and don’t have a problem with having deliverables ready on time.

-12-

Teachers know how to inspire and motivate a group.
Every team can benefit from a voice that helps each individual become their best.

In a well-run classroom, every student is celebrated for their strengths and encouraged to build upon them to become better. Defeat is viewed as a temporary condition and those struggles are used to build strength. “I can’t” is replaced with “I can’t yet, but I’m getting there.” Who wouldn’t want that same energy in their team?

Teachers can teach.

And they can also do so much more.

Lesson of the Day

Other than guided exercises, I have not yet used map in Python (a combination of loving comprehensions and not taking the time to understand map). After reading through a brief tutorial on how map works, I’m now actively looking for opportunities to practice it.

Frustration of the Day

This is actually more of a sad than a frustration. A few conversations this week really ignited my teacher guilt about leaving. I just keep telling myself that they will be okay.

Win of the Day

I just received the pre-work material for my bootcamp program with the caveat that it may be difficult. I looked through it and nothing was unfamiliar. That would NOT have been the case a year ago!

Current Standing on the Imposter Syndrome Scale

3/5

Design a site like this with WordPress.com
Get started