From 2b5a8ea055a0680a2b349a578c6bbf287c8c32b8 Mon Sep 17 00:00:00 2001 From: alphaCTzo7G Date: Wed, 4 Jul 2018 12:19:33 -0700 Subject: [PATCH] Fixes example code in docstring of pandas.DataFrame.query --- pandas/core/frame.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index a420266561c5a..24e344fa9870c 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2839,9 +2839,9 @@ def query(self, expr, inplace=False, **kwargs): Examples -------- - >>> from numpy.random import randn - >>> from pandas import DataFrame - >>> df = pd.DataFrame(randn(10, 2), columns=list('ab')) + >>> import numpy as np + >>> import pandas as pd + >>> df = pd.DataFrame(np.random.randn(10, 2), columns=list('ab')) >>> df.query('a > b') >>> df[df.a > df.b] # same result as the previous expression """