Issue 1:
In below screenshot, I am scanning the database for a categorical called classification_id with the value 50ef44b795e6e42cd2000001 but I am getting a data-row where the categorical has the value 50ef44b795e6e42cd6000001`.

How is this possible? Note that my list of categorical is huge, more than 4 million entries, with 12 million total rows. (Yes, on average, each classification_id appears 3 times.)

On a side note: The display of this one row of numpy in the line with .values at the end takes a lot of time, possibly due to large size of the Categorical, can that be avoided somehow?

Here's my required meta-data for the bug report:

pandas Version: 0.17.0

INSTALLED VERSIONS

commit: None

python: 3.4.3.final.0

python-bits: 64

OS: Darwin

OS-release: 14.5.0

machine: x86_64

processor: i386

byteorder: little

LC_ALL: None

LANG: en_US.UTF-8

pandas: 0.17.0

nose: 1.3.7

pip: 7.1.2

setuptools: 18.3.2

Cython: None

numpy: 1.10.0

scipy: 0.16.0

statsmodels: None

IPython: 4.1.0-dev

sphinx: None

patsy: None

dateutil: 2.4.2

pytz: 2015.6

blosc: None

bottleneck: None

tables: 3.2.2

numexpr: 2.4.4

matplotlib: 1.4.3

openpyxl: None

xlrd: None

xlwt: None

xlsxwriter: None

lxml: None

bs4: None

html5lib: None

httplib2: None

apiclient: None

sqlalchemy: 1.0.8

pymysql: None

psycopg2: None

Issue 2:
Code Sample, a copy-pastable example if possible

# Your code here
cdef inline void remove_var(double val, double *nobs, double *mean_x,
double *ssqdm_x) nogil:
""" remove a value from the var calc """
cdef double delta

# Not NaN
if val == val:
nobs[0] = nobs[0] - 1
if nobs[0]:
# a part of Welford's method for the online variance-calculation
# https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
delta = val - mean_x[0]
mean_x[0] = mean_x[0] - delta / nobs[0]
ssqdm_x[0] = ssqdm_x[0] - ((nobs[0] + 1) * delta ** 2) / nobs[0]
else:
mean_x[0] = 0
ssqdm_x[0] = 0

nobs is a pointer to a double and is incremented and decrement accordingly as add_var and remove_var are called. if nobs == 0, then you want to reset mean_x and ssqdm_x to 0 as you do in the else condition. my question is this -- isn't it possible that nobs could be some epsilon value and not exactly equal to 0.0 ? I dont know floating point math that well, and it could be fine since all we do is incrememt by1 or decrement by 1 so it could be fine. just wondering in case this should be:
if abs(nbos[0]) < 1e-11 or something

thanks

Problem description

[this should explain why the current behaviour is a problem and why the expected output is a better solution.]

Note: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!

Note: Many problems can be resolved by simply upgrading pandas to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if master addresses this issue, but that is not necessary.

For documentation-related issues, you can check the latest versions of the docs on master here:

https://pandas-docs.github.io/pandas-docs-travis/

If the issue has not been resolved there, go ahead and file it in the issue tracker.

Expected Output

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]