-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
invoking pivot_table results in unwanted row #27842
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
Comments
sorry, cause my english isn't very well, I have edit this issue for many times to correct some unwanted mistake. |
@yuylyp I'm not sure of The easiest workaround is to set the name to None before writing In [5]: dfp.index.name
Out[5]: 'animal'
In [6]: dfp.index.name = None
In [7]: dfp
Out[7]:
len mean
color black white black white
cat 1 1 18 25
wolf 1 0 23 0 |
@TomAugspurger |
@TomAugspurger |
Sorry, I didn't realize it still wrote a blank line. That's been reported in #27772 |
thanks for providing #27772, those are the same question totally. |
@TomAugspurger |
@TomAugspurger |
I don't plan to work on this. If you're interested, the contributing guide
is at https://dev.pandas.io/development/contributing.html. Let us know if
you need help getting started.
…On Tue, Aug 13, 2019 at 6:54 AM Tom Li ***@***.***> wrote:
@TomAugspurger <https://github.com/TomAugspurger>
I found the reason and pointed it out in #27772 (comment)
<#27772 (comment)>
however it is just an workaround. it still needs more work.
could you please submit this issue and help improve the experience of
to_excel while we are using multiindex column.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#27842?email_source=notifications&email_token=AAKAOIWOL2JGYUJZDEF2J5TQEKOGTA5CNFSM4IKTADT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4FNNEY#issuecomment-520803987>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIWD3DXIGKJDHOR2MHDQEKOGTANCNFSM4IKTADTQ>
.
|
I have encounterd an issue with pd.pivot_table. this function adds unexpected row and I have no idea to remove it.
below is the code:
the result is:
Problem description
pivot_table adds unwanted row below the MultiIndex. this row starts with 'animal' which is the index name.
I have read though related docs and tried possible parameters.
Finallly I found there is no way to remove it.
Expected Output
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit : None
python : 3.7.4.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 10, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.None
pandas : 0.25.0
numpy : 1.17.0
pytz : 2019.2
dateutil : 2.8.0
pip : 19.2.1
setuptools : 41.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.1
numexpr : 2.6.9
odfpy : None
openpyxl : 2.6.2
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.3.0
sqlalchemy : None
tables : None
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : None
The text was updated successfully, but these errors were encountered: