fbpx
Home Blog Page 1437

Should We Abolish the Death Penalty?

0
Should We Abolish the Death Penalty?

In 2018, the United States executed 25 people and over 2,700 prisoners remain on “death row.” It is one of only 56 nations in the world that still practice capital punishment.

Last week, California Gov. Gavin Newsom announced a moratorium on capital punishment in his state. Watch the one-minute video above announcing his decision.

Should the United States as a country stop using the death penalty? Is it ever justified, such as for the most heinous crimes? Or do you think it is always cruel and unusual punishment? Alternatively, do you think it should be suspended for practical reasons, such as because it is costly or sometimes unfairly administered?

In “California Death Penalty Suspended; 737 Inmates Get Stay of Execution,” Tim Arango writes:

LOS ANGELES — Gov. Gavin Newsom announced a moratorium on capital punishment on Wednesday, granting a temporary reprieve for the 737 inmates on the state’s death row, the largest in the Western Hemisphere.

The move is highly symbolic because legal challenges have already stalled executions in California; the last one was in 2006. But death penalty opponents hope that because of California’s size and political importance, the governor’s action will give new urgency to efforts to end executions in other states as popular support for the death penalty wanes.

Mr. Newsom, a longtime opponent of capital punishment, cited its high cost, racial disparities in its application and wrongful convictions, and questioned whether society has the right to take a life.

“I know people think eye for eye, but if you rape, we don’t rape,” he said. “And I think if someone kills, we don’t kill. We’re better than that.”

He continued, “I cannot sign off on executing hundreds and hundreds of human beings, knowing — knowing — that among them will be innocent human beings.”

Supporters of capital punishment said the move went against the will of the state’s residents. California voters have rejected an initiative to abolish the death penalty and in 2016, they narrowly approved Proposition 66 to help speed it up.

“I think this would be a bold step and I think he’s got to be aware of the political downside,” said Michael D. Rushford, president of the Criminal Justice Legal Foundation, an organization in Sacramento that favors the death penalty and helped draft the ballot proposition, speaking before the governor’s announcement. “Voters have had multiple opportunities in California over three decades to abandon the death penalty and they’ve shut them down at every chance.”

The article continues:

After the news of Mr. Newsom’s decision broke, Mr. Trump said on Twitter: “Defying voters, the Governor of California will halt all death penalty executions of 737 stone cold killers. Friends and families of the always forgotten VICTIMS are not thrilled, and neither am I!”

Speaking several hours later, Mr. Newsom said he had met with families of victims and they had expressed passionate but conflicting views on capital punishment. But the governor made it clear that his decision came down to his own conscience, prodded by impending decisions such as whether to support the state’s lethal injection protocol.

An executive order Mr. Newsom signed on Wednesday does three things: grants reprieves to the inmates currently on death row — they will still be under a death sentence, but not at risk of execution; closes the execution chamber at San Quentin prison; and withdraws the state’s lethal injection protocol, the formally approved procedure for carrying out executions.

“Three out of four nations in the world know better and are doing better,” Mr. Newsom said. “They’ve abolished the death penalty. It’s time California join those ranks.”

The article concludes:

Opponents of the death penalty, including Mr. Newsom, have long argued that the practice is rife with racial disparities and is not justified by the high cost to state taxpayers. One study, in 2011, found that California pays $184 million a year to sustain capital punishment — or close to an accumulated $5 billion since the practice was reinstituted in 1978.

In February, Mr. Newsom intervened in a high-profile death row case that for years activists have claimed was a prime example of racial injustice.

Kevin Cooper, a black man who was convicted of four brutal murders by stabbing in 1983, has long maintained his innocence. His supporters have put forward evidence that he was framed by San Bernardino officers. Mr. Newsom ordered DNA testing in the case, something that state officials had refused to do in the past.

The possibility of wrongful convictions — nationally, more than 150 people on death row have been exonerated since the mid-1970s, according to the National Coalition to Abolish the Death Penalty — has also energized the opposition movement, around the country and in California.

Last April in California, a man who had been on death row for 25 years for murdering a young girl, a former farmworker named Vicente Figueroa Benavides, was freed after a court determined that testimony given at his trial was false.

Students, read the entire article, then tell us:

— Do you support or oppose the use of the capital punishment? Should it be abolished in the United States?

— Do you think the death penalty serves a necessary purpose, like deterring crime, providing relief for victims’ families or imparting justice? Or is capital punishment “cruel and unusual punishment” and therefore prohibited by the Constitution?

— What is your reaction to Gov. Newsom’s moratorium announcement? Which of his arguments for a moratorium do you find most persuasive? Which are the least?

— The article states:

But in 2016, Californians doubled down on the death penalty, approving a measure that streamlined the appeals process, which has typically taken about 25 years in California for condemned prisoners. The initiative, which was backed by many law enforcement officials and prosecutors, passed with 51 percent of the vote, belying California’s national image as place where politics was steadily moving to the left. It was approved at the same time that voters legalized marijuana.

Do you think Mr. Newsom was right to issue a moratorium despite recent votes in support of the death penalty by California’s residents? Do you think it violates the will of the state’s residents, or should he follow his own conscience? Should public opinion matter in cases like capital punishment?

— How concerned should we be about wrongful convictions? Do you have concerns about the fair application of the death penalty, or about the possibility of the criminal justice system executing an innocent person? Do the recent cases of Kevin Cooper and Vicente Figueroa Benavides, cited in the article, affect your views?

Ask a Data Engineer: Warby Parker Edition 👓

0
Ask a Data Engineer: Warby Parker Edition 👓

wp-header

Codecademy’s very own Nick Duckwiler (left) and Ryan Tuck from Warby Parker (right) in our office. (📷: Mitch Boyer)

Last month, Codecademy and Warby Parker came together to work on a special Learn SQL from Scratch Capstone Project. It was during this time when I met Ryan Tuck, a Data Engineer at Warby, who played a major part in this partnership. So when he decided to drop by our office for the final QA round, I had to break out my notebook and ask some questions. Enjoy.


Hey Ryan, let’s start off with a question I’ve had for a while — what is a Data Engineer? (Is it similar to a Data Analyst or a Software Engineer?)

At Warby Parker, data engineers are responsible for creating and maintaining the plumbing required to support the data and reporting needs of the business. We use software engineering practices to automate the work of data cleaning, normalizing, and model building so that data is always ready to be consumed by data analysts in every department.

What languages/frameworks do you use at Warby?

On data engineering, we use Python as our general purpose programming language, as do most of the other teams in our Technology department. When it comes to databases, we use PostgreSQL for the majority of our SQL needs, and are beginning to use Amazon Athena and Google BigQuery for some of our larger datasets. We use Looker as our exclusive business intelligence entry point to all of this data.

What are some of the projects you worked on?

I’ve had the privilege of working with a lot of of smart people in every department at our company to help them solve their varied data needs, from reconciling financial data with the Accounting team to automating and modeling standardized performance metrics for our team of over 200 customer experience advisors.

As part of a team of five supporting the data needs of a rapidly growing company, I’ve tried where possible to focus on helping our analysts solve their own problems. This includes helping people learn Python and commit to our codebase, guiding the creation of data models in SQL, and encouraging people to submit pull requests to add features in Looker, our BI tool.

Seeing dozens of otherwise “non-technical” colleagues opening up PRs on a daily basis, and consequently being part of the democratization of tech that we value at Warby Parker, is probably the most rewarding “project” I’ve been a part of.

One project finished recently during our first annual “Hackweek” is called Pipes, which allows anyone at the company to easily move large amounts of data from wherever to wherever (Looker, Google Sheets, PostgreSQL, BigQuery, etc) on a regular cadence, or manually through a simple one-line chatbot interface. The adoption has been overwhelmingly positive and we’re looking to grow this sort of tooling out even more.

“We use software engineering practices to automate the work of data cleaning, normalizing, and model building so that data is always ready to be consumed by data analysts in every department.”

What got you into the data field?

I’ve always been drawn to analytical fields like math, and became pretty proficient in Excel during some internships in college. Once I had learned to program and learned more about data science and its applications in artificial intelligence, I knew that anything I could do to immerse myself in the world of data would be a step in the right direction.

Three and a half years ago, I landed a job as a junior software engineer at Warby Parker not fully knowing what I was in for, but am so glad I got the opportunity to help build tools to support an interesting and ever-changing data-driven culture here.

Where did you learn SQL and Python?

I had a background in C++, and was exposed to Python through an Intro to Data Science course. When Warby Parker hired me onto the Data team in 2015, I had never written a SQL query in my life, but picked it up quickly and within a few months started up internal SQL training classes, which I still teach on a monthly basis.

What does your tattoo say?


The ultimate cheatsheet.

This is Bayes’ Theorem, which is an equation that describes how to update probabilities given new evidence. Two summers ago I worked on building a tool to help predict weekly fantasy football performance. Some colleagues suggested a Bayesian approach would be appropriate, since there aren’t really enough data points in an NFL season to be able to use statistical approaches that require larger datasets, and I’d want to regularly update my predictions after each player’s latest performance.

I did a deep dive into understanding the (simple) math underlying Bayes’ Theorem and came out of that experience with a whole new worldview, understanding my entire knowledge of the world as a big and intricate probabilistic model that I was continuously updating with every experience I ever have. It was pretty transformative, and I figured that was worth a tattoo.

What is a concept in SQL/Python that’s essential to your work?

Donald Knuth said, “Premature optimization is the root of all evil.” I’ve generally found this to be true, and try to live by it in my work. For example, I’ll generally prefer to keep a data model simple by rebuilding it for all time on a daily basis using a single SQL query instead of making a more complicated model that requires iteratively adding to a table, keeping track of state, updated timestamps, when something last ran, etc.

A wise man once said, “Duplicating data makes things go fast,” but databases are already impressively fast to begin with, without implementing anything to improve performance. Ultimately, I almost always approach a problem thinking about optimizing for my time over machine time, for readability over performance, and for introducing as little cognitive overhead as is required by the problem at hand. Only once performance issues or readability issues present themselves will some code be worth a rewrite.

Last question! Since you wrote Warby Parker’s internal SQL training courses, I know there gotta be some inner Curriculum Developer in you. Can you teach a SQL concept in 2 minutes?

Sure! Have you ever written a query that yields some result set and you think, “I’d love to query the stuff I just produced like it was a table?” Enter the WITH clause.

Suppose I have a mega query that gives the transaction summaries:

select
    transactions.date as transaction_date,
    sum(items.price) as total_cost,
    count(*) as number_of_items
from
    transactions
inner join
    customers
    on
    customers.id = transactions.customer_id
inner join
    transaction_items
    on
    transactions.id = transaction_items.transaction_id
inner join
    items
    on
    items.id = transaction_items.item_id

Using WITH, I can create a temporary table within my query that I can SELECT from and treat it just like a regular old table.

I will put everything from the previous query in a parentheses and use WITH to give it the name transaction_summaries.

Then I’ll apply the date and customer filtering down below for a more readable query, to separate out all the JOIN logic from the actual WHERE filters that I want to apply on that data.

with transaction_summaries as (
  select
      transactions.date as transaction_date,
      sum(items.price) as total_cost,
      count(*) as number_of_items
  from
      transactions
  inner join
      customers
      on
      customers.id = transactions.customer_id
  inner join
      transaction_items
      on
      transactions.id = transaction_items.transaction_id
  inner join
      items
      on
      items.id = transaction_items.item_id
)

select 
        * 
from 
        transaction_summaries
where 
        first_name = 'beyonce'
        and 
        transaction_date > '2018–01–01'
order by 
        total_cost desc
limit 
        5

If you’re familiar with subqueries, this does a similar thing but makes the SQL far more readable, even if your query isn’t quite as performant as it would have been. This is essentially an implementation of the mantra “Don’t Repeat Yourself” that’s common in the world of programming.

Incredible. And love the SQL styling! 😍


Huge shout out to Ryan and the whole Warby Parker team for making this partnership happen. Special hat tips for behind-the-scenes support from:

  • Lon Binder, Chief Technology Officer, Warby Parker
  • Maddie Tierney, Executive Assistant, Warby Parker
  • Kayla Robbins, Executive Assistant, Warby Parker
  • Kaki Read, Senior Communications Manager, Warby Parker
  • Isabel Seely, Senior Brand Manager, Warby Parker

It’s been an absolute pleasure. And of course, the fam at Codecademy. You know who you are. Couldn’t do it without you.

Magnifying Glass

0
Magnifying Glass

What do you think this image is saying? Can you relate to it personally in any way? What is your opinion of its message?

Tell us in the comments, then read the related article to see what this illustration is all about.

Find many more ways to use our Picture Prompt feature in this lesson plan.

Word + Quiz: per se

0
Word + Quiz: per se

: with respect to its inherent nature

_________

The term per se has appeared in 139 articles on NYTimes.com in the past year, including on March 8 in “U.S. Women’s Team Takes a Stand as Gender Disparities Remain Widespread” by Marc Tracy, Karen Crouse and Matthew Futterman:

For all the gains that women have made in golf — the increase in playing opportunities in college and the integration of formerly all-male private clubs — the disparity in purses between the women of the L.P.G.A. Tour and the men of the PGA Tour continues to be striking.

… Brittany Lincicome, a two-time major champion, said that when she chooses to practice at T.P.C. Tampa Bay near her home she is required to pay cart fees. Card-carrying members of the PGA Tour incur no such fees.

What bothers Lincicome is not the fee per se, “but the principle of it,” she said. “I’m a well-known L.P.G.A. player.”

_________

Weekly News Quiz for Students: New Zealand Shooting, College Admissions Scandal, Student Protests

0
Weekly News Quiz for Students: New Zealand Shooting, College Admissions Scandal, Student Protests

How well did you follow the news this past week? How many of these 10 questions can you get right?

Do You Participate in March Madness?

0
Do You Participate in March Madness?

Are you ready for March Madness?

On Sunday, the N.C.A.A. announced the 68 teams that will compete in the 2019 Division I men’s basketball tournament from Tuesday through April 8.

About 47 million people — one in five American adults — are expected to bet a combined $8.5 billion on the tournament.

Will you watch any of the games? Will you fill out a bracket? Who do you think will win the tournament?

In “N.C.A.A. Tournament: Duke and the A.C.C. Rule the Bracket,” Marc Tracy writes:

Duke was given the No. 1 overall seed in the N.C.A.A. Division I men’s basketball tournament Sunday night, starting Coach Mike Krzyzewski and his star freshman Zion Williamson on a path to what they hope will be the Blue Devils’ sixth national title.

Duke (29-5) was one of three Atlantic Coast Conference teams to receive top seeds, joining Virginia (29-3) and North Carolina (27-6). It was the second time members of the same conference were named three of the four No. 1s; the Big East did so in 2009.

The fourth No. 1 seed was Gonzaga (30-3), the small stalwart from Spokane, Wash. While the Bulldogs lost the West Coast Conference title game to St. Mary’s last week, they already have a win over Duke on their résumé from a tournament in late November in Hawaii.

Of course, a top seed is no ticket to the Final Four in Minneapolis. Or even to the second round. Last year, for the first time in 136 such games, a No. 16 seed defeated a No. 1 when the University of Maryland-Baltimore County stunned Virginia.

And in, “Six N.C.A.A. Upset Picks to Enliven Your Bracket,” Mr. Tracy writes:

We call them upsets. But unless you root for the team on the wrong end of one, they are the happiest things on Earth. They should be called overjoyeds.

There are two kinds of tournament underdogs. There is the team that makes an unlikely deep run — to the second weekend, the regional final, the Final Four — by artfully dodging the biggest threats, by emerging as a great squad in its own right. Then there is the team that knocks off a contender before normalcy reasserts itself. The first kind is a new planet, or an aged single-malt scotch; the second kind is a comet, or a tequila shot.

Here are some tequila shots. No predictions are made for this year’s Loyola-Chicago, the No. 11 seed that made last year’s Final Four through the blessings of Sister Jean, good shooting and the luck of facing a No. 9 seed in the regional final.

Rather, these six teams stand a better chance of winning their first games than you — and, more important, the other people in your pool — might think. Don’t sleep on the unlikeliest likeliest of all, at the bottom.

Here are two of Mr. Tracy’s upset picks:

No. 12 vs. No. 5

Murray State Will Beat Marquette

WHY IT WILL HAPPEN Basketball is a team sport, sure, but sometimes you just want to know which team has the best player on the court. And with all due respect to the Golden Eagles’ sensational Markus Howard, the answer is Murray State — thanks to high-flying guard Ja Morant, a sophomore who has played his way into N.B.A. lottery pick status.

No. 14 vs. No. 3

Yale Will Beat Louisiana State

WHY IT WILL HAPPEN It is refreshing that, this year, the jokes will not be about Ivy League elitism but Ivy League corruption: This is a positive development for the democratic sensibility. Unfortunately (or fortunately), the Ivy League remains one of the better midmajor conferences; it has gone 4-6 in opening N.C.A.A. tournament games over the last 10 seasons. This year’s Bulldogs were the league’s best team, per KenPom.com, and the team boasts an N.B.A. prospect in the junior Miye Oni.

Students, choose one of the articles and read it in its entirety, then tell us:

— How excited are you about March Madness? Will you watch or go to any of the games? Which teams are you rooting for?

— Will you fill out a bracket or join a pool this year? If so, what do you like about doing it, and why? Is the bracket competition more fun than the actual games? Why or why not?

— Which teams do you predict will be in the Final Four? Who will win? Will there be any major upsets this year? What matchups are you most looking forward to watching? Do you agree with any of Mr. Tracy’s picks?

— Will you be watching any of the games in the women’s Division I bracket, which was announced on Monday? Baylor (31-1), Mississippi State (30-2), Louisville (29-3) and Notre Dame (30-3) earned No. 1 seeds in this year’s field.

— If basketball isn’t your thing, what bracket-style competition can you imagine that you might enjoy more? For instance, maybe you’d like to participate in March Book Madness?

Learning With: ‘Mercury Is in Retrograde. Don’t Be Alarmed.’

0
Learning With: ‘Mercury Is in Retrograde. Don’t Be Alarmed.’

Before reading the article:

Did you know that Mercury is in retrograde?

From March 5 to March 28, as it typically does three times a year, Mercury, the closest planet to the sun, appears to move backward across the sky — from east to west rather than from west to east.

Have you seen any negative effects in your life? Have you been more cautious about your actions? Or do you think fear or caution, based on astrological events, is nonsense?

Watch the four-minute video, “Astrology Is Fake but It’s Probably Fine,” and answer the following questions:

• Why is the “mystical internet” on the rise, according to the video?

• Why does Amanda Hess believe that online astrology is less about predicting the future and more about helping to better understand ourselves?

• What does Ms. Hess believe are the positive aspects of this rising interest in astrology?

Now, read the article, “Mercury Is in Retrograde. Don’t Be Alarmed,” and answer the following questions:

1. What do astrologists warn us about while Mercury is in retrograde?

2. While Mercury may appear to be moving backward, what, scientifically, is taking place between Mercury and Earth’s orbit?

3. What evidence does the author present of astrology’s growing presence online? Which online communities represent the most significant growth?

4. Why are millennials increasingly drawn to online astrology?

5. How do some practitioners of astrology respond to skeptics and critics who call it “pseudoscience”? What do astrology defenders believe to be the positive benefits?

6. Chani Nicholas, an astrologer, says:

My main concern is that everyone has access to the therapies and practices that are healing to them. And if astrology is not that for you, then great, move on.

What do you think of her statement? Should people who don’t believe in astrology just move on? Do you think there is any value in pushing back against astrology? Do you think there is anything harmful about astrology?

Finally, tell us more about what you think:

— Do you believe in astrology? Or do you think it is harmless fiction? Or alternatively, do you think it’s actually harmful in any way — a dangerous pseudoscience or a hoax?

— Do you think the alignment of planets or stars has any influence on human life? Does the article make you more or less interested in what Amanda Hess calls the “mystical internet?” Will you change your behavior while Mercury is in retrograde?

— Do you regularly read your horoscope or discuss your astrological sign? If so, why? If not, what do you think of those who do? Have you ever visited an astrology or so-called mystical internet site? If yes, why? Does it provide you with a sense of spirituality? Community? Self-understanding?

— Why do you think astrology is on the rise? Is it a good thing? What evidence or personal experience do you have to support your opinion?

Blockchain Revolution for the Enterprise: Coursera and INSEAD launch new Specialization taught by blockchain pioneer, Don Tapscott

0
Blockchain Revolution for the Enterprise: Coursera and INSEAD launch new Specialization taught by blockchain pioneer, Don Tapscott

Blockchain is poised to reshape nearly every industry as companies work to increase security and anonymity, drive efficiencies, lower costs, and more. In fact, Gartner forecasts the market opportunity for blockchain to exceed $3.1 trillion between now and 2030, creating considerable demand for blockchain talent. But we don’t just need technical developers who can help build this technology — it’s also crucial that business professionals understand the fundamentals of blockchain and its applications. This applies to executive levels as well as operational roles within an organization.  

Today, we’re excited to partner with INSEAD, one of the world’s top business schools to launch ‘Blockchain Revolution for the Enterprise,’ a new Specialization taught by Don Tapscott, adjunct professor at INSEAD and co-founder of the Blockchain Research Institute (BRI). Tapscott is one of the world’s leading authorities on blockchain and the role technology plays in business and society. With content derived from the BRI’s multi-million dollar research program, the four-course Specialization is designed to introduce business professionals to the world of blockchain and teach them how to strategically leverage the technology to create scalable business opportunities.

“Educating leaders is one of the keys to accelerating the widespread adoption of blockchain,” said Tapscott. “Working with INSEAD and Coursera, we’ve been able to develop the world’s definitive online course for blockchain in business. This will be invaluable to learners around the world.”

With no programming background necessary, Blockchain Revolution for the Enterprise enables mid-career and senior business professionals to:

  • Understand a high-level view of blockchain and how they can position themselves within this ecosystem
  • Critically evaluate various claims, applications, use-cases, and implementation challenges of blockchain technology using seven design principles  
  • Produce a Blockchain Opportunity Analysis to assess the feasibility of a blockchain application within their own industry or organization

“Blockchain, a technology predicted to disrupt many industries, is being viewed both as a threat and an opportunity,” said Peter Zemsky, Deputy Dean and Dean of Innovation at INSEAD. “It is important for INSEAD to lead the way to offer a universally accessible learning program to help demystify this technology and to prepare future leaders for this transformation.”

The first course in the Blockchain Revolution for the Enterprise Specialization is available today, with additional courses rolling out through next week. Coursera and INSEAD will also be launching a number of vertical-focused Specializations that adapt this content for specific application in industries like healthcare, finance, and supply chain.

As blockchain presents another wave of technological disruption, we believe learners need flexible, affordable ways to keep up. We are humbled to collaborate with industry leaders like Don Tapscott and INSEAD to provide an accessible pathway that empowers learners with skills that can transform their careers and their businesses.

To enroll or learn more, visit https://www.coursera.org/specializations/blockchain-revolution-enterprise

How to Tackle a Data Science Project

0
How to Tackle a Data Science Project

In hopes of pursuing a career in Public Policy, I’ve spent the past year reorienting my programming towards Data Science. Naturally, doing so required significant practice finding, reading, visualizing and analyzing data. This experience has impressed upon me the importance of having a framework in mind when tackling a big data project.

To demonstrate this, I will use my most recent data science project, which you can read more about here. Hopefully, the steps suggested below aide you in creating a framework for your own projects.

Step One: Familiarize yourself with your area of interest.

Context is key when analyzing any dataset, and unfortunately, many otherwise impressive works have been ruined by the author’s lack of familiarity with the subject matter. This doesn’t mean that you’ll have to know every surrounding detail. Working with large datasets would be impossible if that was the case. However, if you’re going to write about wage growth, you’ll need to know the difference between real and nominal wages. If you want to analyze migration patterns to the United States, you should probably read about the 1965 Immigration Act.

A key part of my piece was learning about the history of American colleges—where they initially formed, the circumstances that caused college enrollment to accelerate in the 20th century, and how students with degrees compare to students without degrees. Equally important was familiarizing myself with current research regarding intergenerational mobility. Without the background knowledge I gained from doing this, I would have struggled mightily in finding a dataset suited to answering my question.

You will inevitably make mistakes, and that’s why peer review has its own step. But some background reading will save you a good bit of time and prevent a truly erroneous error from getting through. If you’re lucky, step two will be completed in the midst of step 1.

Step Two: Determine your question

What do you want to know?

Unfortunately, this step doesn’t end with simple curiosity. When deciding what your question should be, you need to consider a number of complementary ones.

  • How likely is it that the information you are looking for exists?
  • Has this question been answered before? If so, what is distinct about your approach?
  • Are you comfortable enough with the math and/or logic necessary to answer this question?
  • Is this question interesting enough to you to sustain your frustration when you inevitably encounter difficulty?

My research went a long way in explaining the difference in collegiate and non collegiate incomes, while also exploring the divergent prospects between high education countries and low education counties. What was missing was the difference in outcomes between different colleges. This inspired me to explore mobility from the standpoint of the colleges themselves, and that led me to discovering Raj Chetty’s “Mobility Report Cards”.

The length of this step can vary drastically. Sometimes, what you need can be found on the Census or Bureau of Labor Statistics. These are accurate, trustworthy databases that, barring a few edge cases, will give you a fairly comprehensive picture of what you’re trying to discover. Needless to say, it’s not always that easy. It can take hours, if not days, to find the dataset you need.

As mentioned earlier, my background research allowed me to quickly identify the right dataset for analyzing college mobility rates. Chetty’s “Mobility Report Cards” had substantial information concerning student school selectivity and income for multiple decades. The data they used was provided by the Department of Education and the Internal Revenue Service, and it was clearly documented and laid out.

image2

This documentation made the whole process exponentially easier. I couldn’t have asked for a better dataset. Unfortunately, expecting this for every project is unrealistic, and likely to severely hamper your motivation. It can take a long time to find the right datasets, and sometimes you’re only able to find data that is auxiliary to your main question. In these situations, my advice would be twofold:

  • Reach out to others and see if someone more familiar with the subject knows where to locate the correct data.
  • Consider modifying your question according to what you have and repeating step two.

This can be a long, painful process. While plowing through the mud is oftentimes necessary, don’t ever be afraid to adjust your parameters based on what you have.

Step 4: Familiarize yourself with the dataset

You will likely be creating several visualizations from this data, and cross checking it throughout the project. Before you start, take an hour or so to explore it. Create simple graphs, find the maxima/minima, visualize the distribution. Most importantly, see if you can isolate trends within your data.

image3

This step, along with step 1, is a great way of preemptively identifying trends in your dataset. The graph above is a scatter plot of college tiers vs the percentage of parents at the top of the national income quartile. Drawing the regression line showed me what to expect when plotting the differences in top quartile representation by college tier. The same was also true for median income.

image1

This proved immensely valuable, as knowing the trend in the data allowed me to quickly identify when I had made a mistake in creating the graphs I ended up using for the final piece. Simple plotting can be an invaluable tool when preparing yourself for a more thorough analysis.

Conclusion

Learn the subject, find your question, choose your dataset, and familiarize with it. Hopefully, these steps aide you in creating your own work. Analyzing and visualizing data is frustrating, often monotonous work, especially when you’re still learning the ropes as I am. However, the power that comes from being able to make unique observations and contribute to the historical conversation is well worth the effort.

So go on and give it your best shot.

Ask a Data Engineer: Warby Parker Edition 👓

0
Ask a Data Engineer: Warby Parker Edition 👓

wp-header

Codecademy’s very own Nick Duckwiler (left) and Ryan Tuck from Warby Parker (right) in our office. (📷: Mitch Boyer)

Last month, Codecademy and Warby Parker came together to work on a special Learn SQL from Scratch Capstone Project. It was during this time when I met Ryan Tuck, a Data Engineer at Warby, who played a major part in this partnership. So when he decided to drop by our office for the final QA round, I had to break out my notebook and ask some questions. Enjoy.


Hey Ryan, let’s start off with a question I’ve had for a while — what is a Data Engineer? (Is it similar to a Data Analyst or a Software Engineer?)

At Warby Parker, data engineers are responsible for creating and maintaining the plumbing required to support the data and reporting needs of the business. We use software engineering practices to automate the work of data cleaning, normalizing, and model building so that data is always ready to be consumed by data analysts in every department.

What languages/frameworks do you use at Warby?

On data engineering, we use Python as our general purpose programming language, as do most of the other teams in our Technology department. When it comes to databases, we use PostgreSQL for the majority of our SQL needs, and are beginning to use Amazon Athena and Google BigQuery for some of our larger datasets. We use Looker as our exclusive business intelligence entry point to all of this data.

What are some of the projects you worked on?

I’ve had the privilege of working with a lot of of smart people in every department at our company to help them solve their varied data needs, from reconciling financial data with the Accounting team to automating and modeling standardized performance metrics for our team of over 200 customer experience advisors.

As part of a team of five supporting the data needs of a rapidly growing company, I’ve tried where possible to focus on helping our analysts solve their own problems. This includes helping people learn Python and commit to our codebase, guiding the creation of data models in SQL, and encouraging people to submit pull requests to add features in Looker, our BI tool.

Seeing dozens of otherwise “non-technical” colleagues opening up PRs on a daily basis, and consequently being part of the democratization of tech that we value at Warby Parker, is probably the most rewarding “project” I’ve been a part of.

One project finished recently during our first annual “Hackweek” is called Pipes, which allows anyone at the company to easily move large amounts of data from wherever to wherever (Looker, Google Sheets, PostgreSQL, BigQuery, etc) on a regular cadence, or manually through a simple one-line chatbot interface. The adoption has been overwhelmingly positive and we’re looking to grow this sort of tooling out even more.

“We use software engineering practices to automate the work of data cleaning, normalizing, and model building so that data is always ready to be consumed by data analysts in every department.”

What got you into the data field?

I’ve always been drawn to analytical fields like math, and became pretty proficient in Excel during some internships in college. Once I had learned to program and learned more about data science and its applications in artificial intelligence, I knew that anything I could do to immerse myself in the world of data would be a step in the right direction.

Three and a half years ago, I landed a job as a junior software engineer at Warby Parker not fully knowing what I was in for, but am so glad I got the opportunity to help build tools to support an interesting and ever-changing data-driven culture here.

Where did you learn SQL and Python?

I had a background in C++, and was exposed to Python through an Intro to Data Science course. When Warby Parker hired me onto the Data team in 2015, I had never written a SQL query in my life, but picked it up quickly and within a few months started up internal SQL training classes, which I still teach on a monthly basis.

What does your tattoo say?


The ultimate cheatsheet.

This is Bayes’ Theorem, which is an equation that describes how to update probabilities given new evidence. Two summers ago I worked on building a tool to help predict weekly fantasy football performance. Some colleagues suggested a Bayesian approach would be appropriate, since there aren’t really enough data points in an NFL season to be able to use statistical approaches that require larger datasets, and I’d want to regularly update my predictions after each player’s latest performance.

I did a deep dive into understanding the (simple) math underlying Bayes’ Theorem and came out of that experience with a whole new worldview, understanding my entire knowledge of the world as a big and intricate probabilistic model that I was continuously updating with every experience I ever have. It was pretty transformative, and I figured that was worth a tattoo.

What is a concept in SQL/Python that’s essential to your work?

Donald Knuth said, “Premature optimization is the root of all evil.” I’ve generally found this to be true, and try to live by it in my work. For example, I’ll generally prefer to keep a data model simple by rebuilding it for all time on a daily basis using a single SQL query instead of making a more complicated model that requires iteratively adding to a table, keeping track of state, updated timestamps, when something last ran, etc.

A wise man once said, “Duplicating data makes things go fast,” but databases are already impressively fast to begin with, without implementing anything to improve performance. Ultimately, I almost always approach a problem thinking about optimizing for my time over machine time, for readability over performance, and for introducing as little cognitive overhead as is required by the problem at hand. Only once performance issues or readability issues present themselves will some code be worth a rewrite.

Last question! Since you wrote Warby Parker’s internal SQL training courses, I know there gotta be some inner Curriculum Developer in you. Can you teach a SQL concept in 2 minutes?

Sure! Have you ever written a query that yields some result set and you think, “I’d love to query the stuff I just produced like it was a table?” Enter the WITH clause.

Suppose I have a mega query that gives the transaction summaries:

select
    transactions.date as transaction_date,
    sum(items.price) as total_cost,
    count(*) as number_of_items
from
    transactions
inner join
    customers
    on
    customers.id = transactions.customer_id
inner join
    transaction_items
    on
    transactions.id = transaction_items.transaction_id
inner join
    items
    on
    items.id = transaction_items.item_id

Using WITH, I can create a temporary table within my query that I can SELECT from and treat it just like a regular old table.

I will put everything from the previous query in a parentheses and use WITH to give it the name transaction_summaries.

Then I’ll apply the date and customer filtering down below for a more readable query, to separate out all the JOIN logic from the actual WHERE filters that I want to apply on that data.

with transaction_summaries as (
  select
      transactions.date as transaction_date,
      sum(items.price) as total_cost,
      count(*) as number_of_items
  from
      transactions
  inner join
      customers
      on
      customers.id = transactions.customer_id
  inner join
      transaction_items
      on
      transactions.id = transaction_items.transaction_id
  inner join
      items
      on
      items.id = transaction_items.item_id
)

select 
        * 
from 
        transaction_summaries
where 
        first_name = 'beyonce'
        and 
        transaction_date > '2018–01–01'
order by 
        total_cost desc
limit 
        5

If you’re familiar with subqueries, this does a similar thing but makes the SQL far more readable, even if your query isn’t quite as performant as it would have been. This is essentially an implementation of the mantra “Don’t Repeat Yourself” that’s common in the world of programming.

Incredible. And love the SQL styling! 😍


Huge shout out to Ryan and the whole Warby Parker team for making this partnership happen. Special hat tips for behind-the-scenes support from:

  • Lon Binder, Chief Technology Officer, Warby Parker
  • Maddie Tierney, Executive Assistant, Warby Parker
  • Kayla Robbins, Executive Assistant, Warby Parker
  • Kaki Read, Senior Communications Manager, Warby Parker
  • Isabel Seely, Senior Brand Manager, Warby Parker

It’s been an absolute pleasure. And of course, the fam at Codecademy. You know who you are. Couldn’t do it without you.