Skip to content

Pandas inplace argument is not explicit True or False #14189

Closed
@jrovegno

Description

@jrovegno

Any Serie or DataFrame method with arguments inplace != [0, False, None, [], {}] process inplace operation.
Is not explicit True or False like in the documentation.
Other methods tested: where, mask, sort_index
Any bool(arg) == True is accepted
Like: inplace='Fail' , inplace=3, inplace=[0]

Maybe is not a bug, but can generate problems if someone is not careful using positional arguments, like me.

Code Sample, a copy-pastable example if possible

df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6], 'C': [7, 8, 9]})
df.where(lambda x: x > 4, lambda x: x + 10, 'fail')

Expected Output

Out[72]: 
    A   B  C
0  11  14  7
1  12   5  8
2  13   6  9

output of pd.show_versions()

pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: AMD64 Family 18 Model 1 Stepping 0, AuthenticAMD
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.18.1
nose: 1.3.7
pip: 8.1.2
setuptools: 25.1.6
Cython: 0.23.4
numpy: 1.11.1
scipy: 0.18.0
statsmodels: 0.6.1
xarray: 0.8.1
IPython: 5.1.0
sphinx: 1.3.5
patsy: 0.4.1
dateutil: 2.5.1
pytz: 2016.2
blosc: None
bottleneck: 1.1.0
tables: 3.2.2
numexpr: 2.6.1
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.6.0
bs4: 4.4.1
html5lib: 0.999
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.0
pandas_datareader: 0.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions