The Music of Data Science: 5 Ways Data Science and Music Are Related



Am I crazy for switching careers from music to data science without having any experience? Do I stand a chance in the real world? I don’t know! We can find out together!


“Develop a passion for learning. If you do, you will never cease to grow.” — Anthony J. D’Angelo


Luckily for me I love to learn. It's actually one of my main motivations. This passion to learn steered me into the world of data science where I enrolled in Flatiron's Live Data Science Bootcamp. 


For context, I'm a former musician. When I say that, I don't mean that I played music on the side; I mean I played music as my main source of income. What I'm getting at is that I don't know a whole lot about data science. There's nothing in common with data science and music, is there? 


Well, I'd like to propose that there are some similarities between these fields. Based on what I have experienced in two weeks worth of an intense data science bootcamp, I want to attempt to bridge the gap between data science and music. I don’t expect to make a comprehensive list of all the ways these two fields are similar; afterall, I’m only two weeks in at this point in time. But for my new data science friends, prepare to learn a little about music! And for my long time musician friends, prepare to learn a little about data science! 



At the very start of both data science and music lies the ground rules for how to interpret information, what you can and cannot do, and what to expect.


In bootcamp, one of the first things I learned was how to import a dataset into my jupyter notebook so I can begin to explore it with python. As simple as that is, there is another prerequisite which is to import all the packages (like pandas, numpy, and scipy, etc.) that I plan on using to make life so much easier. These packages have specific commands, or special powers, that don’t exist without them in base python. For instance, I can’t turn my data into a dataframe without pandas. And certain math operations with lists and dictionaries are much more complex in base python than with pandas. 


While there aren’t packages in music, there are certain rules that apply specifically to an individual piece of music. There are things like a time signature, key signature, a clef, and a tempo that give universal rules to the entire piece and inform the player how to interpret what he or she sees. These things answer the questions: What number do I count to? What notes do I count? What key am I in? Where’s middle C? How fast is this song? The answers to those questions provide clarity and establish a framework for interpreting the music.



Music and data science use symbols to define attributes.


In data science, “[ ]” means list, and “{ }” means dictionary. Each of these data structures have attributes specific to them. A dictionary contains a key : value pair, while a list just has values. Therefore, you can do things with dictionaries that you can’t do with lists. For example, with a dictionary you can call a key and have its corresponding value returned. Lists don’t have keys; they have indexes, or their numbered place in line. It’s just not as cool. This becomes super relevant when you’re wrangling data in a json file and there’s a dictionary of dictionaries containing dictionaries of lists with dictionaries and more lists, etc. Basically, the main takeaway here is that lists and dictionaries are different data structures that are differentiated by their use of brackets or braces. 


Music is almost entirely made up of symbols, save for some Italian words and abbreviations which kinda look like symbols in their own right. Note values, rests, sharps, flats, clefs, crescendos, Roman numeral analysis, the list goes on. Symbols are everywhere in music! And each symbol brings meaning and definition to what’s happening. 



Constant evaluations occur within both data science and music.


In data science, we call them “sanity checks”. Does the code chuck I just wrote work? Am I working with the right variable? Does this function work? Did I just delete everything on accident? To answer these questions we do a quick test and evaluate whether or not we’re on the right track. 


In music, this happens so fast that most people don’t even realize that it happens. With every note that is played, the player hears the note he or she is playing along with what the rest of the band is playing and in a split second evaluates the timing and note accuracy of what he or she is playing. Now, the decent musician will intentionally make efforts to ask himself or herself: Am I in time? Did I miss my entrance? Do I sound good? And they take a quick second, usually while still playing, to evaluate what they just did. 



Filtering is part of both the data science and music recording process. 


Often when exploring data, you want to filter out the information you don’t need. Sometimes you don’t need rows with null values; sometimes you don’t need entire columns. One way to filter data is to isolate a particular column or group of columns so that you can easily see the data you’re looking for. 


This happens in the studio all the time. It is very common practice to filter out the unnecessary audio information by  “soloing”, or isolating, an instrument or a group of instruments from the soundboard. Sound engineers do this so they can adjust instrument specific settings, troubleshoot issues, or just gain a better understanding of that instrument’s contribution to the song. 



Comments exist in both data science and music.


When coding, it’s good practice to make comments, or notes that aren’t actually part of the code, that inform the reader what is going on or what to look for. These comments can be for yourself or they can be for other people that come along and need to work on the code. They are great for explaining a train of thought or revealing the reasoning behind what you’re coding. 


Musicians make notes in their music margins frequently that aren’t actually part of the music. Most of the time the notes are reminders to do something or to look out for something specific. They can be really helpful to direct their attention to the right thing at the right time. 




At the heart of both of these fields lies the desire to draw meaning from something seemingly chaotic. Whether it’s data from a dataset or notes on a page, there is beauty in the story being told.


Comments

Popular posts from this blog

Behind the Shield: Drum Shields

Why "The Recording" Is Wrong

The Missing Link: Why

The Gift Of Confidence

My Stick Shtick: Navigating Stick Choice In a Sea Of Sticks