Skip to content

Commit a3850c9

Browse files
committed
DOC: Fix code style in documentation #36777 gotchas.rst
1 parent bd4b2ac commit a3850c9

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

doc/source/user_guide/gotchas.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ when calling :meth:`~DataFrame.info`:
2121

2222
.. ipython:: python
2323
24-
dtypes = ['int64', 'float64', 'datetime64[ns]', 'timedelta64[ns]',
25-
'complex128', 'object', 'bool']
24+
dtypes = ["int64", "float64", "datetime64[ns]", "timedelta64[ns]",
25+
"complex128", "object", "bool"]
2626
n = 5000
2727
data = {t: np.random.randint(100, size=n).astype(t) for t in dtypes}
2828
df = pd.DataFrame(data)
29-
df['categorical'] = df['object'].astype('category')
29+
df["categorical"] = df["object"].astype("category")
3030
3131
df.info()
3232
@@ -40,7 +40,7 @@ as it can be expensive to do this deeper introspection.
4040

4141
.. ipython:: python
4242
43-
df.info(memory_usage='deep')
43+
df.info(memory_usage="deep")
4444
4545
By default the display option is set to ``True`` but can be explicitly
4646
overridden by passing the ``memory_usage`` argument when invoking ``df.info()``.
@@ -155,9 +155,9 @@ index, not membership among the values.
155155

156156
.. ipython:: python
157157
158-
s = pd.Series(range(5), index=list('abcde'))
158+
s = pd.Series(range(5), index=list("abcde"))
159159
2 in s
160-
'b' in s
160+
"b" in s
161161
162162
If this behavior is surprising, keep in mind that using ``in`` on a Python
163163
dictionary tests keys, not values, and ``Series`` are dict-like.
@@ -206,11 +206,11 @@ arrays. For example:
206206

207207
.. ipython:: python
208208
209-
s = pd.Series([1, 2, 3, 4, 5], index=list('abcde'))
209+
s = pd.Series([1, 2, 3, 4, 5], index=list("abcde"))
210210
s
211211
s.dtype
212212
213-
s2 = s.reindex(['a', 'b', 'c', 'f', 'u'])
213+
s2 = s.reindex(["a", "b", "c", "f", "u"])
214214
s2
215215
s2.dtype
216216
@@ -227,12 +227,12 @@ the nullable-integer extension dtypes provided by pandas
227227

228228
.. ipython:: python
229229
230-
s_int = pd.Series([1, 2, 3, 4, 5], index=list('abcde'),
230+
s_int = pd.Series([1, 2, 3, 4, 5], index=list("abcde"),
231231
dtype=pd.Int64Dtype())
232232
s_int
233233
s_int.dtype
234234
235-
s2_int = s_int.reindex(['a', 'b', 'c', 'f', 'u'])
235+
s2_int = s_int.reindex(["a", "b", "c", "f", "u"])
236236
s2_int
237237
s2_int.dtype
238238
@@ -334,7 +334,7 @@ constructors using something similar to the following:
334334

335335
.. ipython:: python
336336
337-
x = np.array(list(range(10)), '>i4') # big endian
337+
x = np.array(list(range(10)), ">i4") # big endian
338338
newx = x.byteswap().newbyteorder() # force native byteorder
339339
s = pd.Series(newx)
340340

0 commit comments

Comments
 (0)