Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 319 Bytes

construct_dataframe.rst

File metadata and controls

11 lines (8 loc) · 319 Bytes
orphan:

A pandas DataFrame can be constructed in many different ways, but for a small number of values, it is often convenient to specify it as a Python dictionary, where the keys are the column names and the values are the data.

.. ipython:: python

   df = pd.DataFrame({"x": [1, 3, 5], "y": [2, 4, 6]})
   df