1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Julia

Exercise

Renaming columns

When working with DataFrames, you will inevitably want to make changes to your data, whether it's renaming certain columns or dropping certain rows. In this example, you will look at the former - renaming a column. It can be helpful to rename columns if the current column name is hard to understand or unclear, which will help consumers of your data (including yourself) get a better understanding of what each column represents.

The packages CSV and DataFrames have been loaded for you, as well as a DataFrame into the variable video_game_data.

Inspecting this data will show the column North_American_Sales has a slightly different naming convention than the rest of the columns. This column name is a bit too long, and you want to use the same convention for all the column names, so let's practice renaming this column to something more in line with the others.

Instructions 1/2

undefined XP
    1
    2
  • Show the first row of our data by calling first() on the DataFrame. Make sure you use println to print the output to the terminal.