Skip to content

BUG: Still getting blank when using pandas.Series.to_string(index=False) #36963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 3 tasks
simontorres opened this issue Oct 7, 2020 · 3 comments
Closed
2 of 3 tasks
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@simontorres
Copy link

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

import pandas

print("pandas.__version__ == {:s}".format(pandas.__version__))

columns = ['name', 'age']
values = [
    ['name_one', '31'],
    ['name_two', '32']]
data_frame = pandas.DataFrame(values, columns=columns)

# filter

filtered = data_frame[(data_frame['name'] == 'name_one') & (data_frame['age'] == '31')]
# single value comes with a blank at the beginning when running 0.24.0

print("==={:s}===".format(filtered.name.to_string(index=False)))

Problem description

This was already reported by me on #24980 and supposedly fixed by PR #36094 but I keep getting the same result with pandas 1.1.3.

Using the sample code above the output is === name_one===

I might be missing something but I can't see what.

Expected Output

Using the sampe code provided I expect it to return ===name_one===

Output of pd.show_versions()

INSTALLED VERSIONS

commit : db08276
python : 3.6.12.final.0
python-bits : 64
OS : Linux
OS-release : 4.9.0-1.el7.elrepo.x86_64
Version : #1 SMP Sun Dec 11 15:43:54 EST 2016
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.1.3
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.2
setuptools : 49.6.0.post20200814
Cython : 0.29.21
pytest : 6.0.2
hypothesis : None
sphinx : 3.2.1
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.2
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None

@simontorres simontorres added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 7, 2020
@erfannariman
Copy link
Member

erfannariman commented Oct 8, 2020

This looks fixed on master and when I check the PR, the milestone was set to 1.2. So the fix is not yet added in 1.1.3.

pandas.__version__ == 1.2.0.dev0+660.g350d8cbaa
===name_one===

@dsaxton
Copy link
Member

dsaxton commented Oct 8, 2020

Seeing the same thing, closing as fixed

@dsaxton dsaxton closed this as completed Oct 8, 2020
@simontorres
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

3 participants