import numpy as np
import pandas as pd
from pandas import Series,DataFrame
读写到粘贴板中
import webbrowser
link = "http://pandas.pydata.org/pandas-docs/version/0.20/io.html"
webbrowser.open(link)
True
df1 = pd.read_clipboard()
df1
| Format Type | Data Description | Reader | Writer | |
|---|---|---|---|---|
| 0 | text | CSV | read_csv | to_csv |
| 1 | text | JSON | read_json | to_json |
| 2 | text | HTML | read_html | to_html |
| 3 | text | Local clipboard | read_clipboard | to_clipboard |
| 4 | binary | MS Excel | read_excel | to_excel |
| 5 | binary | HDF5 Format | read_hdf | to_hdf |
| 6 | binary | Feather Format | read_feather | to_feather |
| 7 | binary | Msgpack | read_msgpack | to_msgpack |
| 8 | binary | Stata | read_stata | to_stata |
| 9 | binary | SAS | read_sas | |
| 10 | binary | Python Pickle Format | read_pickle | to_pickle |
| 11 | SQL | SQL | read_sql | to_sql |
| 12 | SQL | Google Big Query | read_gbq | to_gbq |
import sys #查看Python版本
print (sys.version)
print (sys.version_info)
3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 12:30:02) [MSC v.1900 64 bit (AMD64)]
sys.version

本文主要介绍了如何使用Python的Pandas库进行数据读写操作,特别是与CSV文件的交互,包括CSV的读写、DataFrame与JSON、HTML的转换以及Excel文件的写入。详细列举了各种数据格式的读写函数,如read_csv、to_csv、read_json、to_html、to_excel等。
最低0.47元/天 解锁文章
10万+

被折叠的 条评论
为什么被折叠?



