You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/getting_started/comparison/comparison_with_spreadsheets.rst
+33-4
Original file line number
Diff line number
Diff line change
@@ -62,11 +62,18 @@ particular row don't change.
62
62
See the :ref:`indexing documentation<indexing>` for much more on how to use an ``Index``
63
63
effectively.
64
64
65
-
Commonly used spreadsheet functionalities
66
-
-----------------------------------------
65
+
Data input / output
66
+
-------------------
67
67
68
-
Importing data
69
-
~~~~~~~~~~~~~~
68
+
Constructing a DataFrame from values
69
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70
+
71
+
In a spreadsheet, `values can be typed directly into cells <https://support.microsoft.com/en-us/office/enter-data-manually-in-worksheet-cells-c798181d-d75a-41b1-92ad-6c0800f80038>`_.
72
+
73
+
.. include:: includes/construct_dataframe.rst
74
+
75
+
Reading external data
76
+
~~~~~~~~~~~~~~~~~~~~~
70
77
71
78
Both `Excel <https://support.microsoft.com/en-us/office/import-data-from-external-data-sources-power-query-be4330b3-5356-486c-a168-b68e9e616f5a>`__
72
79
and :ref:`pandas <10min_tut_02_read_write>` can import data from various sources in various
@@ -96,6 +103,28 @@ In pandas, you pass the URL or local path of the CSV file to :func:`~pandas.read
96
103
tips = pd.read_csv(url)
97
104
tips
98
105
106
+
Like `Excel's Text Import Wizard <https://support.microsoft.com/en-us/office/text-import-wizard-c5b02af6-fda1-4440-899f-f78bafe41857>`_,
107
+
``read_csv`` can take a number of parameters to specify how the data should be parsed. For
108
+
example, if the data was instead tab delimited, and did not have column names, the pandas command
# alternatively, read_table is an alias to read_csv with tab delimiter
116
+
tips = pd.read_table("tips.csv", header=None)
117
+
118
+
Exporting data
119
+
~~~~~~~~~~~~~~
120
+
121
+
By default, desktop spreadsheet software will save to its respective file format (``.xlsx``, ``.ods``, etc). You can, however, `save to other file formats <https://support.microsoft.com/en-us/office/save-a-workbook-in-another-file-format-6a16c862-4a36-48f9-a300-c2ca0065286e>`_.
122
+
123
+
:ref:`pandas can create Excel files <io.excel_writer>`, :ref:`CSV <io.store_in_csv>`, or :ref:`a number of other formats <io>`.
0 commit comments