Skip to content

Commit e9a5210

Browse files
authored
Merge pull request #342 from NPalopoli/patch-11
guide.md: added consistency to 04-data-types-and-format section
2 parents ddfe2fc + a3af424 commit e9a5210

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

_extras/guide.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,22 @@ stack_selection.columns = stack_selection.columns.droplevel()
255255

256256
### Challenge - Changing Types
257257

258+
* Try converting the column `plot_id` to floats using `surveys_df.plot_id.astype("float")`.
259+
Then, try converting the contents of the `weight` column to an integer type.
260+
What error messages does Pandas give you? What do these errors mean?
261+
258262
Pandas cannot convert types from float to int if the column contains NaN values.
259263

260264
### Challenge - Counting
265+
266+
* Count the number of missing values per column. Hint: The method `.count()` gives you the number of non-NA observations per column. Try looking to the `.isnull()` method.
267+
268+
~~~
261269
surveys_df.isnull()
270+
~~~
271+
{: .language-python}
262272

263-
If the students have trouble generating the output, or anything happens with that, there is a file
264-
called "sample output" that contains the data file they should generate.
273+
If the students have trouble generating the output, or anything happens with that, the folder `sample_output` in this repository contains the file `surveys_complete.csv` with the data they should generate.
265274

266275
## 05-merging-data
267276

0 commit comments

Comments
 (0)