Đã hoàn thành

data frames exercise

Programming challenge description:

When data is imported into any software environment, there is a risk of introducing bad or invalid data. An essential step before doing any data analysis is to first validate the data to be used. This can save time and avoid problems later.

Imagine a data science team investigating forest fires in the Tropical Forests of the Amazon. They have two datasets in CSV format:

The first dataset represents the gathered statistics of forest fires by the month and year for different states in Brazil

The second dataset has a summary of the total number of fires per year across the entire country

Write a program to validate the first dataset using the summary data from the second.

Input:

Two datasets in CSV format separated by one empty line.

The first dataset has the following columns:

year - the year when forest fires happened

state - Brazilian state

month - the month when forest fires happened

number - the number of reported fires in that year, state, and month

The second dataset has the following columns:

year - the year when forest fires happened

number - the total number of reported fires in that year

For example:

year,state,month,number

2000,Rio,Novembro,18

2002,Pernambuco,Fevereiro,64

2001,Mato Grosso,Maio,112

2003,Roraima,Janeiro,547

2002,Maranhao,Julho,4

2003,Rio,Março,9

2000,Roraima,Outubro,25

2001,Paraiba,Janeiro,11

year,number

2002,68

2000,43

2003,556

2001,123

Output:

Print True if the first dataset appears to be valid.

Otherwise, print False.

Test 1

Test Input

Download Test 1 Input

year,state,month,number

2000,Rio,Novembro,18

2002,Pernambuco,Fevereiro,64

2001,Mato Grosso,Maio,112

2003,Roraima,Janeiro,547

2002,Maranhao,Julho,4

2003,Rio,Março,9

2000,Roraima,Outubro,25

2001,Paraiba,Janeiro,11

year,number

2002,68

2000,43

2003,556

2001,123

Expected Output

Download Test 1 Input

True

Test 2

Test Input

Download Test 2 Input

year,state,month,number

2008,Maranhao,Agosto,713

2009,Tocantins,Maio,91

2008,Pernambuco,Março,32

2007,Paraiba,Janeiro,11

2007,Piau,Setembro,4

2008,Santa Catarina,Dezembro,29

2009,Distrito Federal,Fevereiro,0

2007,Sergipe,Novembro,7

2009,Goias,Junho,179

2008,Rio,Fevereiro,25

year,number

2009,270

2008,713

2007,22

Expected Output

Download Test 2 Input

False

Kĩ năng: Python, Xử lí dữ liệu

Xem nhiều hơn: data structure algorithm programming, data types microcontrollers programming, arrays exercise programming, intro to r exercises, working with data frames in r, rstudio practice, practice data for r, r exercises, r function exercises, r programming workbook, r programming exercises and solutions pdf, data extraction process programming, parser print input file command line valid trivialc, data rate socket programming, star schema university data warehouse exercise, chapter exercise programming example video store, data acquisition embedded programming, data crunching exercise, data entry exercise, data structure and programming

Về Bên Thuê:
( 0 nhận xét ) Coventry, United Kingdom

ID dự án: #27531499

Được trao cho:

HiImEevee

Hello! My name is Andrei Matei and I am new to freelancing, but I am interested in your project as I think I would do a great job with my skill set, and because I also need great portofolio pieces. This means that I wo Thêm

$15 USD trong 2 ngày
(1 Nhận xét)
0.0