CSE 6040 - 7.1 - Merging data frames: join operations - Concepts Flashcards

1
Q

To use the merge operation on the following to tables labeled A & B, what would be the outcome of the following pandas merge command?

C = A.merge (B, on=[‘country’, ‘year’])

A

See pic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

By default, merge() will only include rows from A and B where all keys _____ between the two tables.

A

By default, merge() will only include rows from A and B where all keys match between the two tables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define the type of dataframe Join:

Inner-join (A, B) (default): Keep only rows of A and B where the on-keys ____ __ ____.

It is the _______ behavior of the python join function

A

Inner-join (A, B) (default): Keep only rows of A and B where the on-keys match in both.

It is the default behavior of the python join function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Outer-join (A, B): Keep ___ ____ __ ____ ______, but merge rows when the on-keys match. For non-matches, fill in missing values with not-a-number (NaN) values.

A

Outer-join (A, B): Keep all rows of both frames, but merge rows when the on-keys match. For non-matches, fill in missing values with not-a-number (NaN) values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Left-join (A, B): Keep all rows of A. Only merge rows of B whose on-keys ____ ___.

A

Left-join (A, B): Keep all rows of A. Only merge rows of B whose on-keys match A.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Right-join (A, B): Keep all rows of B. Only merge rows of A whose on-keys _____ __

A

Right-join (A, B): Keep all rows of B. Only merge rows of A whose on-keys match B.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the useful primitive apply() function accomplish?

A

applies a function to a data frame or to a series (column of the data frame).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly