Description
-
[ x] I have checked that this issue has not already been reported.
-
[ x] 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
# Your code here
import pandas as pd
Y0=array([[0.-20.j , 0. +0.j ],
[0. +0.j , 0.-12.j ]])
Y0df=pd.DataFrame(Y0)
print(Y0df.to_latex(header=False,index=False,decimal=','), file=open('Y0.tex', 'w'))
Problem description
The contence of Y0.tex is shown below with only the real part having the correct decimal symbol.
\begin{tabular}{rr}
\toprule
0,000000-20.000000j & 0,000000+0.000000j \
0,000000+0.000000j & 0,000000-12.000000j \
\bottomrule
\end{tabular}
Expected Output
\begin{tabular}{rr}
\toprule
0,000000-20,000000j & 0,000000+0,000000j \
0,000000+0.000000j & 0,000000-12,000000j \
\bottomrule
\end{tabular}
Desired Output
#instead of using 'decimal' an 'use_numprint=True' would be nicer to allow for custom customisation within LaTeX, which would ideally produce the following output
%uncomment the following line if not already defined
%\newcommand{\np}[2][]{\numprint[#1]{#2}}
\begin{tabular}{rr}
\toprule
\np{0.000000}-\np{20.000000}j & \np{0.000000}+\np{0.000000}j \
\np{0.000000}+\np{0.000000}j & \np{0.000000}-\np{12.000000}j \
\bottomrule
\end{tabular}
Output of pd.show_versions()
INSTALLED VERSIONS
commit : db08276
python : 3.8.5.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.18362
machine : AMD64
processor : Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en
LOCALE : English_South Africa.1252
pandas : 1.1.3
numpy : 1.19.2
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.4
setuptools : 50.3.1.post20201107
Cython : 0.29.21
pytest : 6.1.1
hypothesis : None
sphinx : 3.2.1
blosc : None
feather : None
xlsxwriter : 1.3.7
lxml.etree : 4.6.1
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.19.0
pandas_datareader: None
bs4 : 4.9.3
bottleneck : 1.3.2
fsspec : 0.8.3
fastparquet : None
gcsfs : None
matplotlib : 3.3.2
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.5
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.2
sqlalchemy : 1.3.20
tables : 3.6.1
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
numba : 0.51.2