August 2021
Beginner to intermediate
112 pages
1h 29m
English
| Puzzle 21 | What’s the Points? |
| | import pandas as pd |
| | |
| | df = pd.DataFrame([[1, 2], [3, 4]], columns=['x', 'y']) |
| | print(df.to_csv()) |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print:
| | ,x,y |
| | 0,1,2 |
| | 1,3,4</code></pre></td> |
What’s with the unnamed column that has 0 and 1 values?
The pandas.DataFrame documentation says:
Data structure also contains labeled axes (rows and columns). ...
Read now
Unlock full access