国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > Python > 正文

python將pandas datarame保存為txt文件的實(shí)例

2020-02-23 06:27:06
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

CSV means Comma Separated Values. It is plain text (ansi).

The CSV ("Comma Separated Value") file format is often used to exchange data between disparate applications. The file format, as it is used in Microsoft Excel, has become a pseudo standard throughout the industry, even among non-Microsoft platforms.

TXT is not really a file format, and it could mean multiple things in different contexts. Generally you export tables in either CSV (comma separated values) or TSV (tab separated values). Which you should choose depends mainly on your data: if your data has commas in it but not tabs, you should go for TSV.

# -*- coding: UTF-8 -*-import sysimport jsonreload(sys)sys.setdefaultencoding('utf-8') import pandas as pdimport numpy as np  #讀取excel保存成txt格式excel_file = pd.read_excel("text.xlsx")excel_file.to_csv('excel2txt.txt', sep='	', index=False)

參考:https://stackoverflow.com/questions/41428539/data-frame-to-file-txt-python/41514539

以上這篇python將pandas datarame保存為txt文件的實(shí)例就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持武林站長(zhǎng)站。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 田林县| 巴彦淖尔市| 通州市| 阜新市| 亳州市| 梅河口市| 乐都县| 岐山县| 股票| 长乐市| 西昌市| 泸水县| 清镇市| 武汉市| 襄樊市| 汾阳市| 桐梓县| 昌黎县| 洛浦县| 仁怀市| 金秀| 桓台县| 修武县| 波密县| 兴安县| 舒兰市| 集安市| 台东县| 鄂温| 台江县| 隆安县| 扶沟县| 连江县| 喀什市| 马鞍山市| 阿图什市| 长沙县| 铅山县| 桐梓县| 新兴县| 寻乌县|