2.1. Exercises

Name that Argument!

Using Arguments when Reading in Files

Instructions:
Running a coding exercise for the first time could take a bit of time for everything to load. Be patient, it could take a few minutes.

When you see ____ in a coding exercise, replace it with what you assume to be the correct code. Run it and see if you obtain the desired output. Submit your code to validate if you were correct.

Load in the data using the most suitable arguments.

Tasks:

  • Read in the first 100 rows and columns name, total_bs and type from the file pokemon.csv, which is located in the data directory.
  • Save the resulting dataframe as pokemon_sample.
  • Display pokemon_sample.
Hint 1
  • Are you sure you are saving your dataframe as pokeman_df?
  • Are you using pd.read_csv()?
  • Are you including the full path through the data/ folder when calling the file name?
  • Do you the argument nrows=100?
  • Are you loading in the specified column index labels?
  • Perhaps you are using index_col=0 when it was not required?
Fully worked solution: