Skip to content

Commit 9412870

Browse files
authored
added consistency to 04-data-types-and-format
Added Challenge guidelines (taken from the lesson) and language markup to section 04-data-types-and-format for consistency with the other sections.
1 parent 220aaec commit 9412870

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

_extras/guide.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,20 @@ stack_selection.columns = stack_selection.columns.droplevel()
245245

246246
### Challenge - Changing Types
247247

248+
* Try converting the column `plot_id` to floats using `surveys_df.plot_id.astype("float")`. Next try converting `weight` to an integer. What goes wrong here? What is Pandas telling you?
249+
248250
Pandas cannot convert types from float to int if the column contains NaN values.
249251

250252
### Challenge - Counting
253+
254+
* 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.
255+
256+
~~~
251257
surveys_df.isnull()
258+
~~~
259+
{: .language-python}
252260

253-
If the students have trouble generating the output, or anything happens with that, there is a file
254-
called "sample output" that contains the data file they should generate.
261+
If the students have trouble generating the output, or anything happens with that, there is a file called "sample output" that contains the data file they should generate.
255262

256263
## 05-merging-data
257264

0 commit comments

Comments
 (0)