@@ -81,9 +81,28 @@ index is passed, one will be created having values ``[0, ..., len(data) - 1]``.
81
81
82
82
**From dict **
83
83
84
- If ``data `` is a dict, if **index ** is passed the values in data corresponding
85
- to the labels in the index will be pulled out. Otherwise, an index will be
86
- constructed from the sorted keys of the dict, if possible.
84
+ Series can be instantiated from dicts:
85
+
86
+ .. ipython :: python
87
+
88
+ d = {' b' : 1 , ' a' : 0 , ' c' : 2 }
89
+ pd.Series(d)
90
+
91
+ .. note ::
92
+
93
+ When the data is a dict, and an index is not passed, the ``Series `` index
94
+ will be ordered by the dict's insertion order, if you're using Python
95
+ version >= 3.6 and Pandas version >= 0.23.
96
+
97
+ If you're using Python < 3.6 or Pandas < 0.23, and an index is not passed,
98
+ the ``Series `` index will be the lexically ordered list of dict keys.
99
+
100
+ In the example above, if you were on a Python version lower than 3.6 or a
101
+ Pandas version lower than 0.23, the ``Series `` would be ordered by the lexical
102
+ order of the dict keys (i.e. ``['a', 'b', 'c'] `` rather than ``['b', 'a', 'c'] ``).
103
+
104
+ If an index is passed, the values in data corresponding to the labels in the
105
+ index will be pulled out.
87
106
88
107
.. ipython :: python
89
108
@@ -243,12 +262,22 @@ not matching up to the passed index.
243
262
If axis labels are not passed, they will be constructed from the input data
244
263
based on common sense rules.
245
264
265
+ .. note ::
266
+
267
+ When the data is a dict, and ``columns `` is not specified, the ``DataFrame ``
268
+ columns will be ordered by the dict's insertion order, if you are using
269
+ Python version >= 3.6 and Pandas >= 0.23.
270
+
271
+ If you are using Python < 3.6 or Pandas < 0.23, and ``columns `` is not
272
+ specified, the ``DataFrame `` columns will be the lexically ordered list of dict
273
+ keys.
274
+
246
275
From dict of Series or dicts
247
276
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248
277
249
278
The resulting **index ** will be the **union ** of the indexes of the various
250
279
Series. If there are any nested dicts, these will first be converted to
251
- Series. If no columns are passed, the columns will be the sorted list of dict
280
+ Series. If no columns are passed, the columns will be the ordered list of dict
252
281
keys.
253
282
254
283
.. ipython :: python
0 commit comments