Files
freeCodeCamp/curriculum/challenges/italian/08-data-analysis-with-python/data-analysis-with-python-projects/demographic-data-analyzer.md
2022-11-24 18:12:05 -08:00

5.0 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5e46f7e5ac417301a38fb929 Analizzatore di dati demografici 10 462367 demographic-data-analyzer

--description--

Lavorerai a questo progetto con il nostro codice iniziale su Replit.

  • Start by importing the project on Replit.
  • Next, you will see a .replit window.
  • Select Use run command and click the Done button.

Stiamo ancora sviluppando la parte didattica interattiva del curriculum di Python. Per ora, ecco alcuni video sul canale YouTube di freeCodeCamp.org che ti insegneranno tutto quello che devi sapere per completare questo progetto:

--instructions--

In questa sfida è necessario analizzare i dati demografici utilizzando Pandas. Ti viene fornito un insieme di dati demografici estratti dalla banca dati del Census del 1994. Ecco un esempio di come appaiono i dati:

|    |   age | workclass        |   fnlwgt | education   |   education-num | marital-status     | occupation        | relationship   | race   | sex    |   capital-gain |   capital-loss |   hours-per-week | native-country   | salary   |
|---:|------:|:-----------------|---------:|:------------|----------------:|:-------------------|:------------------|:---------------|:-------|:-------|---------------:|---------------:|-----------------:|:-----------------|:---------|
|  0 |    39 | State-gov        |    77516 | Bachelors   |              13 | Never-married      | Adm-clerical      | Not-in-family  | White  | Male   |           2174 |              0 |               40 | United-States    | <=50K    |
|  1 |    50 | Self-emp-not-inc |    83311 | Bachelors   |              13 | Married-civ-spouse | Exec-managerial   | Husband        | White  | Male   |              0 |              0 |               13 | United-States    | <=50K    |
|  2 |    38 | Private          |   215646 | HS-grad     |               9 | Divorced           | Handlers-cleaners | Not-in-family  | White  | Male   |              0 |              0 |               40 | United-States    | <=50K    |
|  3 |    53 | Private          |   234721 | 11th        |               7 | Married-civ-spouse | Handlers-cleaners | Husband        | Black  | Male   |              0 |              0 |               40 | United-States    | <=50K    |
|  4 |    28 | Private          |   338409 | Bachelors   |              13 | Married-civ-spouse | Prof-specialty    | Wife           | Black  | Female |              0 |              0 |               40 | Cuba             | <=50K    |

È necessario utilizzare Pandas per rispondere alle seguenti domande:

  • How many people of each race are represented in this dataset? This should be a Pandas series with race names as the index labels. (race column)
  • What is the average age of men?
  • What is the percentage of people who have a Bachelor's degree?
  • What percentage of people with advanced education (Bachelors, Masters, or Doctorate) make more than 50K?
  • What percentage of people without advanced education make more than 50K?
  • What is the minimum number of hours a person works per week?
  • What percentage of the people who work the minimum number of hours per week have a salary of more than 50K?
  • What country has the highest percentage of people that earn >50K and what is that percentage?
  • Identify the most popular occupation for those who earn >50K in India.

Utilizza il codice iniziale nel file demographic_data_analyzer. Aggiorna il codice in modo che tutte le variabili impostate su "None" siano impostate al calcolo o al codice appropriato. Arrotonda tutti i decimali al decimo (una cifra decimale) più vicino.

I test unitari sono scritti per te in test_module.py.

Sviluppo

Nello sviluppo, puoi usare main.py per testare le tue funzioni. Fai clic sul pulsante "Run" e main.py verrà eseguito.

Test

Abbiamo importato i test da test_module.py in main.py per tua convenienza. I test saranno eseguiti automaticamente quando usi il bottone "run".

Invio

Copia l'URL del tuo progetto e consegnalo nell'input qua sotto.

Fonte Dataset

Dua, D. e Graff, C. (2019). UCI Machine Learning Repository. Irvine, CA: University of California, School of Information and Computer Science.

--hints--

Dovrebbe superare tutti i test Python.


--solutions--

  # 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.