pandas 讀寫文件

數(shù)據(jù)導(dǎo)入

pd.read_csv(filename):從CSV文件導(dǎo)入數(shù)據(jù)
pd.read_table(filename):從限定分隔符的文本文件導(dǎo)入數(shù)據(jù)
pd.read_excel(filename):從Excel文件導(dǎo)入數(shù)據(jù)
pd.read_sql(query, connection_object):從SQL表/庫導(dǎo)入數(shù)據(jù)
pd.read_json(json_string):從JSON格式的字符串導(dǎo)入數(shù)據(jù)
pd.read_html(url):解析URL、字符串或者HTML文件
pd.read_clipboard():從粘貼板獲取內(nèi)容
pd.DataFrame(dict):從字典對象導(dǎo)入數(shù)據(jù)

數(shù)據(jù)導(dǎo)出

df.to_csv(filename):導(dǎo)出數(shù)據(jù)到CSV文件
df.to_excel(filename):導(dǎo)出數(shù)據(jù)到Excel文件
df.to_sql(table_name, connection_object):導(dǎo)出數(shù)據(jù)到SQL表
df.to_json(filename):以Json格式導(dǎo)出數(shù)據(jù)到文本文件

read

read_csv
read_html

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容