August 2021
Beginner to intermediate
112 pages
1h 29m
English
| Puzzle 17 | Not My Type |
| | import pandas as pd |
| | |
| | df1 = pd.DataFrame([[1, 2], [3, 4]], columns=['a', 'b']) |
| | df2 = pd.DataFrame([[5, 6], [7, 8]], columns=['b', 'c']) |
| | df = pd.concat([df1, df2]) |
| | print(df.dtypes) |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print:
| | a float64 |
| | b int64 |
| | c float64 |
| | dtype: object</code></pre></td> |
If you look at the dtypes of df1 and df2, you’ll ...
Read now
Unlock full access