Files
.github
api-server
client
config
curriculum
challenges
_meta
arabic
chinese
english
01-responsive-web-design
02-javascript-algorithms-and-data-structures
03-front-end-libraries
04-data-visualization
05-apis-and-microservices
06-quality-assurance
07-scientific-computing-with-python
08-data-analysis-with-python
data-analysis-with-python-course
data-analysis-example-a.english.md
data-analysis-example-b.english.md
data-cleaning-and-visualizations.english.md
data-cleaning-duplicates.english.md
data-cleaning-introduction.english.md
data-cleaning-with-dataframes.english.md
how-to-use-jupyter-notebooks-intro.english.md
introduction-to-data-analysis.english.md
jupyter-notebooks-cells.english.md
jupyter-notebooks-importing-and-exporting-data.english.md
numpy-algebra-and-size.english.md
numpy-arrays.english.md
numpy-boolean-arrays.english.md
numpy-introduction-a.english.md
numpy-introduction-b.english.md
numpy-operations.english.md
pandas-condtitional-selection-and-modifying-dataframes.english.md
pandas-creating-columns.english.md
pandas-dataframes.english.md
pandas-indexing-and-conditional-selection.english.md
pandas-introduction.english.md
parsing-html-and-saving-data.english.md
python-functions-and-collections.english.md
python-introduction.english.md
python-iteration-and-modules.english.md
reading-data-csv-and-txt.english.md
reading-data-from-databases.english.md
reading-data-introduction.english.md
data-analysis-with-python-projects
numpy
09-information-security
10-coding-interview-prep
11-machine-learning-with-python
12-certificates
portuguese
russian
spanish
schema
test
.babelrc
.editorconfig
.npmignore
.travis.yml
CHANGELOG.md
LICENSE.md
commitizen.config.js
commitlint.config.js
create-challenge-bundle.js
getChallenges.js
gulpfile.js
lib.js
md-translation.js
package-entry.js
package-lock.json
package.json
utils.js
cypress
docs
search-indexing
tools
utils
.editorconfig
.eslintignore
.eslintrc.json
.gitattributes
.gitignore
.gitpod.yml
.node-inspectorrc
.npmrc
.prettierignore
.prettierrc
.snyk
.travis.yml
.vcmrc
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile.tests
HoF.md
LICENSE.md
README.md
SECURITY.md
change_volumes_owner.sh
cypress-install.js
cypress.json
docker-compose-shared.yml
docker-compose.tests.yml
docker-compose.yml
jest.config.js
lerna.json
package-lock.json
package.json
sample.env
2020-05-28 19:10:36 +05:30

1.2 KiB

id, title, challengeType, isHidden, videoId
id title challengeType isHidden videoId
5e9a093a74c4063ca6f7c15c Pandas Creating Columns 11 true _sSo2XZoB3E

Description

Tests

question:
  text: |
    What code would add a "Certificates per month" column to the `certificates_earned` DataFrame like the one below?:

    ```
          Certificates  Time (in months)  Certificates per month
    Tom               8                16                    0.50
    Kris              2                 5                    0.40
    Ahmad             5                 9                    0.56
    Beau              6                12                    0.50
    ```

  answers:
    - |
      ```py
      certificates_earned['Certificates'] /
      certificates_earned['Time (in months)']
      ```
    - |
      ```py
      certificates_earned['Certificates per month'] = round(
          certificates_earned['Certificates'] / 
          certificates_earned['Time (in months)']
      )
      ```
    - |
      ```py
      certificates_earned['Certificates per month'] = round(
          certificates_earned['Certificates'] /
          certificates_earned['Time (in months)'], 2
      )
      ```
  solution: 3