diff --git a/doc/source/getting_started/comparison/comparison_with_spreadsheets.rst b/doc/source/getting_started/comparison/comparison_with_spreadsheets.rst index 13029173b2e65..aecd90a071129 100644 --- a/doc/source/getting_started/comparison/comparison_with_spreadsheets.rst +++ b/doc/source/getting_started/comparison/comparison_with_spreadsheets.rst @@ -89,13 +89,6 @@ Both `Excel ` can import data from various sources in various formats. -Excel files -''''''''''' - -Excel opens `various Excel file formats `_ -by double-clicking them, or using `the Open menu `_. -In pandas, you use :ref:`special methods for reading and writing from/to Excel files `. - CSV ''' @@ -125,6 +118,27 @@ would be: # alternatively, read_table is an alias to read_csv with tab delimiter tips = pd.read_table("tips.csv", header=None) +Excel files +''''''''''' + +Excel opens `various Excel file formats `_ +by double-clicking them, or using `the Open menu `_. +In pandas, you use :ref:`special methods for reading and writing from/to Excel files `. + +Let's first :ref:`create a new Excel file ` based on the ``tips`` dataframe in the above example: + +.. code-block:: python + + tips.to_excel("./tips.xlsx") + +Should you wish to subsequently access the data in the ``tips.xlsx`` file, you can read it into your module using + +.. code-block:: python + + tips_df = read_excel("./tips.xlsx", header=None) + +You have just read in an Excel file using pandas! + Limiting output ~~~~~~~~~~~~~~~