เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Copy the capitals

Sometimes you want to create new columns from your data, and sometimes you want to use an already existing vector. But do you know how to create a new column that only references or only copies the elements of this vector? Let's find out.

You'll be working with the wages dataset, which has been filtered to make things easier. Now it only contains the data for the year 1994. You'll be adding a new column, containing the capitals for each state. Let's try the different methods!

The wages dataset and the DataFrames package have been loaded for you.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Data Manipulation in Julia

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Create new column by referencing
____

capitals[9] = "N/A"

println(wages[9,:])
แก้ไขและรันโค้ด