mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-01-05 12:06:36 -05:00
72 lines
3.2 KiB
Markdown
72 lines
3.2 KiB
Markdown
---
|
|
id: 5e4f5c4b570f7e3a4949899f
|
|
title: Pronosticador del nivel del mar
|
|
challengeType: 10
|
|
forumTopicId: 462370
|
|
dashedName: sea-level-predictor
|
|
---
|
|
|
|
# --description--
|
|
|
|
Estarás <a href="https://replit.com/github/freeCodeCamp/boilerplate-sea-level-predictor" target="_blank" rel="noopener noreferrer nofollow">trabajando en este proyecto con nuestro código de inicio Replit</a>.
|
|
|
|
- Start by importing the project on Replit.
|
|
- Next, you will see a `.replit` window.
|
|
- Select `Use run command` and click the `Done` button.
|
|
|
|
|
|
Todavía estamos desarrollando la parte interactiva del currículo de Python. Por ahora, aquí hay algunos videos en el canal de YouTube de freeCodeCamp.org que te enseñaran todo lo que necesitas saber para completar este proyecto:
|
|
|
|
- <a href="https://www.freecodecamp.org/news/python-for-everybody/" target="_blank" rel="noopener noreferrer nofollow">Python for Everybody Video Course</a> (14 hours)
|
|
|
|
- <a href="https://www.freecodecamp.org/news/how-to-analyze-data-with-python-pandas/" target="_blank" rel="noopener noreferrer nofollow">How to Analyze Data with Python Pandas</a> (10 hours)
|
|
|
|
# --instructions--
|
|
|
|
Analizará un conjunto de datos sobre el cambio del nivel medio del mar a nivel mundial desde 1880. Utilizarás los datos para predecir el cambio del nivel del mar hasta el año 2050.
|
|
|
|
Utiliza los datos para completar las siguientes tareas:
|
|
|
|
- Use Pandas to import the data from `epa-sea-level.csv`.
|
|
- Use matplotlib to create a scatter plot using the `Year` column as the x-axis and the `CSIRO Adjusted Sea Level` column as the y-axis.
|
|
- Use the `linregress` function from `scipy.stats` to get the slope and y-intercept of the line of best fit. Plot the line of best fit over the top of the scatter plot. Make the line go through the year 2050 to predict the sea level rise in 2050.
|
|
- Plot a new line of best fit just using the data from year 2000 through the most recent year in the dataset. Make the line also go through the year 2050 to predict the sea level rise in 2050 if the rate of rise continues as it has since the year 2000.
|
|
- The x label should be `Year`, the y label should be `Sea Level (inches)`, and the title should be `Rise in Sea Level`.
|
|
|
|
Las pruebas unitarias están escritas para en `test_module.py`.
|
|
|
|
El boilerplate también incluye los comandos para guardar y devolver la imagen.
|
|
|
|
## Desarrollo
|
|
|
|
Para el desarrollo, puedes utilizar `main.py` para probar tus funciones. Haz clic en el botón "run" y se ejecutará `main.py`.
|
|
|
|
## Pruebas
|
|
|
|
Importamos las pruebas de `test_module.py` a `main.py` para tu conveniencia. Las pruebas se ejecutarán automáticamente cada vez que pulses el botón "run".
|
|
|
|
## Envío
|
|
|
|
Copia el enlace de tu proyecto y envíalo a freeCodeCamp.
|
|
|
|
## Fuente de datos
|
|
|
|
<a href="https://datahub.io/core/sea-level-rise" target="_blank" rel="noopener noreferrer nofollow">Global Average Absolute Sea Level Change</a>, 1880-2014 de la Agencia de Protección Ambiental de los Estados Unidos utilizando datos de CSIRO, 2015; NOAA, 2015.
|
|
|
|
|
|
# --hints--
|
|
|
|
Debería pasar todas las pruebas de Python.
|
|
|
|
```js
|
|
|
|
```
|
|
|
|
# --solutions--
|
|
|
|
```py
|
|
# Python challenges don't need solutions,
|
|
# because they would need to be tested against a full working project.
|
|
# Please check our contributing guidelines to learn more.
|
|
```
|