Python export CSV data strong> span> p>
to_csv(filePath,sep=”,”,index=TRUE,header=TRUE)
sep separator, default to comma (“, “)
index whether to export row serial number, default is TRUE
Whether the
header exports the column name, the default is TRUE
Get the stock data from Tushare library and export
import tushare as ts
df=ts.sh_margins(start=’2015-01-01′, end=’2015-04-19′)
df.to_csv(“d://df.csv”)
df file opens as:
p>
import tushare as ts ab = ts. Sh_margins (start = ‘2015-01-01’, end = ‘2015-04-19’).
ab to_csv (” d:// ab. CSV, “index = False) p>
if index changes to false, then:
p>
Read More:
- python reads csv file is an error _csv.Error: iterator should return strings, not bytes (did you open the file in text)
- No code, a solution to the error in the path of reading CSV file by Python: filenotfounderror: [errno 2] no such file or directory: ‘XX. CSV‘
- Datagrip import & export table structure and data
- The solution to the error of importing CSV from Python to Python
- Pandas read the CSV file error filenotf oundError:File b ‘***.csv’ does not exist
- Neo4j LOAD CSV Error: Query cannot conclude with LOAD CSV
- spark SQL Export Data to Kafka error [How to Solve]
- When reading the CSV file with Python 3, the Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0xd0 in position 0: invalid con appears
- Using sqoop to export data from hive to MySQL
- Postman returns to the data window and displays the JSON format by default
- JSON data format net.sf.json .JSONException: A JSONObject text must begin with ‘{‘ at character 1 of Error:(f…
- The problem of “value error: zero length field name in format” in Python 2.6.6 of CentOS 6.9
- Convert Tencent video QLV format to MP4 format
- invalid connection string format, a valid format is host:ip:port
- Extract audio from ffmpeg video to mp3 format or m4a format command
- Jetson nano uses Python to read and parse GPS data (GPRMC, gpgga).
- HBase import CSV file
- Coursera Using python to access Web data quiz 4
- Removing stop words —— Python Data Science CookBook
- Python data cleaning — delete failed images__ Simple version