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

首頁 > 編程 > Python > 正文

python將pandas datarame保存為txt文件的實例

2020-02-16 01:06:26
字體:
來源:轉載
供稿:網友

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='/t', index=False)

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

以上這篇python將pandas datarame保存為txt文件的實例就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持武林站長站。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 安义县| 固始县| 兴义市| 黑龙江省| 宁晋县| 静海县| 新密市| 中江县| 商南县| 嘉黎县| 罗城| 子长县| 罗田县| 安徽省| 沙河市| 商都县| 宜都市| 长顺县| 珲春市| 岑巩县| 黄大仙区| 连城县| 镇安县| 武功县| 台东县| 屏东县| 甘肃省| 广饶县| 安丘市| 景东| 崇义县| 迁西县| 安多县| 民和| 新蔡县| 西贡区| 石屏县| 绵竹市| 高雄市| 天峻县| 德令哈市|