import <span class="wp_keywordlink_affiliate"><a href="https://www.168seo.cn/tag/pandas" title="View all posts in pandas" target="_blank">pandas</a></span> as pd import numpy as np xls = pd.ExcelFile('aa.xlsx') df = xls.parse('Sheet1') df2 = xls.parse('Sheet2') xls.sheet_names # see all sheet names xls.parse(sheet_name) # read a specific sheet to DataFrame df.to_<span class="wp_keywordlink_affiliate"><a href="https://www.168seo.cn/tag/csv" title="View all posts in csv" target="_blank">csv</a></span>('cc.<span class="wp_keywordlink_affiliate"><a href="https://www.168seo.cn/tag/csv" title="View all posts in csv" target="_blank">csv</a></span>',encoding=('utf-8')) #写入<span class="wp_keywordlink_affiliate"><a href="https://www.168seo.cn/tag/csv" title="View all posts in csv" target="_blank">csv</a></span>中
1
2
3
4
5
6
7
8
9
10
|
import
pandas
as
pd
import
numpy
as
np
xls
=
pd
.
ExcelFile
(
'aa.xlsx'
)
df
=
xls
.
parse
(
'Sheet1'
)
df2
=
xls
.
parse
(
'Sheet2'
)
xls
.
sheet_names
# see all sheet names
xls
.
parse
(
sheet_name
)
# read a specific sheet to DataFrame
df
.
to_csv
(
'cc.csv'
,
encoding
=
(
'utf-8'
)
)
#写入csv中
|