Hi!
I was trying to filter data and view the result of some selective columns, but can’t figure out.
I created a dataframe first,
using DataFrames
df = DataFrame(
name = ["a", "b", "c", "d"],
quiz_1 = [14,15,13,14],
quiz_2 = [18,16,16,17],
presentation = [7,6,6,8],
final = [42,46,47,49])
name quiz_1 quiz_2 presentation final
String Int64 Int64 Int64 Int64
1 a 14 18 7 42
2 b 15 16 6 46
3 c 13 16 6 47
4 d 14 17 8 49
In this dataframe, for example, I want to see only quiz_1
and quiz_2
columns, who scored more than 45 in the final.
I was able to filter using,
filter(row -> row.final > 45, df)
name quiz_1 quiz_2 presentation final
String Int64 Int64 Int64 Int64
1 b 15 16 6 46
2 c 13 16 6 47
3 d 14 17 8 49
Here, all the columns are shown in the output, but I can’t figure out how to get the result only of quiz_1
and quiz_2
columns. Can anyone help me out?