DataFrame.to_csv() behaves differently when passing compression parameter
If i use:

    df.to_csv('dir1/dir2/test.csv.zip')

or

    df.to_csv('dir1/dir2/test.csv', compression='zip')

to save a csv file, i found that
1. the path name no matter reletive or absolute will be included in the zip archive
2. the extension name of the actual file in the zip archive will be kept the same with the one you passed in which means if you pass in 'zip' you get a 'zip' in the archive.

None of the above are true if extension name is one of [‘.gz’, ‘.bz2’, or ‘.xz’] or compression mode is one of [‘gzip’, ‘bz2’], are those desirable behavior rather than keep them all the same?

Additionly if you set compression mode with one of ['gzip', 'bz2'] and passin the file name with extension 'csv' you get the compressed archive end with '.csv' which is confusing because you will get all hex code if you open it with a text editor.

pd.show_version() output

INSTALLED VERSIONS
------------------
commit           : d9fff2792bf16178d4e450fe7384244e50635733
python           : 3.8.5.final.0
python-bits      : 64
OS               : Darwin
OS-release       : 19.6.0
Version          : Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64
machine          : x86_64
processor        : i386
byteorder        : little
LC_ALL           : None
LANG             : None
LOCALE           : None.UTF-8

pandas           : 1.1.0
numpy            : 1.19.1
pytz             : 2020.1
dateutil         : 2.8.1
pip              : 20.2.2
setuptools       : 49.3.1.post20200810
Cython           : None
pytest           : None
hypothesis       : None
sphinx           : 3.2.1
blosc            : None
feather          : 0.4.1
xlsxwriter       : None
lxml.etree       : 4.5.2
html5lib         : 1.1
pymysql          : 0.10.0
psycopg2         : None
jinja2           : 2.11.2
IPython          : 7.17.0
pandas_datareader: None
bs4              : 4.9.1
bottleneck       : None
fsspec           : None
fastparquet      : None
gcsfs            : None
matplotlib       : 3.3.0
numexpr          : None
odfpy            : None
openpyxl         : 3.0.4
pandas_gbq       : None
pyarrow          : 1.0.0
pytables         : None
pyxlsb           : None
s3fs             : None
scipy            : 1.5.2
sqlalchemy       : 1.3.18
tables           : None
tabulate         : 0.8.7
xarray           : None
xlrd             : 1.2.0
xlwt             : None
numba            : None