Pular para o conteúdo principal
InícioPython

Projeto

Writing Functions for Product Analysis

BásicoNível de habilidade
Actualizado 09/2024
Use coding best practices and functions to improve a script!
Iniciar Projeto

Incluído comPremium or Teams

PythonProgramming45 min8 Tasks1,500 XP4,603

Crie sua conta gratuita

ou

Ao continuar, você aceita nossos Termos de Uso, nossa Política de Privacidade e que seus dados serão armazenados nos EUA.
Group

Treinar 2 ou mais pessoas?

Tentar DataCamp for Business

Amado por alunos de milhares de empresas

Descrição do Projeto

Writing Functions for Product Analysis

Have you ever started your data analysis and ended up with repetitive code? Repetitive code is a sign that functions are needed. Functions help keep our code flexible, maintainable, and interpretable. Our colleague Brenda, a product analyst, has written a script to pull Net Promotor Score (NPS) survey data from multiple sources to calculate the NPS score. This code works well, but it violates coding best practices, including Don't Repeat Yourself (DRY). Let's take a look at her code and write some functions for Brenda! To complete this project, you need to know how to write functions in Python and how to use pandas for DataFrame manipulation.

Writing Functions for Product Analysis

Use coding best practices and functions to improve a script!
Iniciar Projeto
  • 1

    DRY: Don't repeat yourself

  • 2

    Verifying the files with the "with" keyword

  • 3

    Putting it together with nested functions

  • 4

    Detractors, Passives, and Promoters

  • 5

    Applying our function to a DataFrame

  • 6

    Calculating the Net Promoter Score

  • 7

    Breaking down NPS by source

  • 8

    Adding docstrings

Junte-se a mais 17 milhões de alunos e comece Writing Functions for Product Analysis hoje!

Crie sua conta gratuita

ou

Ao continuar, você aceita nossos Termos de Uso, nossa Política de Privacidade e que seus dados serão armazenados nos EUA.