Puzzle 21: What's the Points?

Let's convert a pandas DataFrame to CSV format.

We'll cover the following

Guess the output

Try to guess the output of the code below:

Press + to interact
import pandas as pd
df = pd.DataFrame([[1, 2], [3, 4]], columns=['x', 'y'])
print(df.to_csv())

Quiz

Q

What is the output of the code above?

A)
x,y

1,2

3,4
B)
,x,y

0,1,2

1,3,4
C)
1,2
3,4
D)

SyntaxError

Get hands-on with 1300+ tech skills courses.