BUG: read_csv with mixed bools and int sometimes reads 1 as a bool function.
State: closed

- [x] closes #42808
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

The major issue is that the parser is reading 1 as a boolean expression and not as an integer.

So, making 2 different tests based on the data type of the input or return of a function can help split the parsing as two seperate entities.

Reference: https://github.com/pandas-dev/pandas/pull/42944

Labels:

Comments:
Hello @shubham11941140! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:

* In the file [`pandas/tests/io/parser/test_na_values.py`](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py):

> [Line 594:1](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L594): [E302](https://duckduckgo.com/?q=pep8%20E302) expected 2 blank lines, found 1
> [Line 597:41](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L597): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 597:43](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L597): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 598:56](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L598): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 598:58](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L598): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 600:1](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L600): [E302](https://duckduckgo.com/?q=pep8%20E302) expected 2 blank lines, found 1
> [Line 603:55](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L603): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 603:57](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L603): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 607:1](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L607): [E302](https://duckduckgo.com/?q=pep8%20E302) expected 2 blank lines, found 1
> [Line 610:41](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L610): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 610:43](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L610): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 611:50](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L611): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals
> [Line 611:52](https://github.com/pandas-dev/pandas/blob/684559ecf25feeaddb52f7184040eb6f16a0e180/pandas/tests/io/parser/test_na_values.py#L611): [E251](https://duckduckgo.com/?q=pep8%20E251) unexpected spaces around keyword / parameter equals



##### Comment last updated at 2021-08-23 13:40:10 UTC
It mentions workflow requires approval, please do the same. I have also got few PEP 8 issues. Do I need to solve them?
The code is compiling correctly.
These changes look identical to #42944 with some changes like flipping if statements, test order, and removing comments? 
Ok I will write using reference.
> Ok I will write using reference.

First, if you build off another PR, you should always reference it (otherwise looks like plagiarism). Also that PR is fine, so there is no reason for another one doing the same thing
Could you suggest me how do I study with the codebase and then solve bugs?
Actually the issue is that I know how to solve bugs but I have no idea which files to modify and where to?
The repo is huge due to which I am unable to find and pinpoint issues.
Closing this to not waste CI resources. Please do not copy code without credit in future.
> Could you suggest me how do I study with the codebase and then solve bugs?
> Actually the issue is that I know how to solve bugs but I have no idea which files to modify and where to?

https://pandas.pydata.org/docs/development/contributing.html will be helpful. Learning to use a debugger is the best way to learn how to solve bugs (since finding where to fix issues is the hardest part of solving them)