Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 603b73b

Browse files
Update 01-数据读取与导出.md
1 parent 155126f commit 603b73b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎01-数据读取与导出.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ df = pd.read_excel(r'D:\python\data.xlsx', index_col = 2) #指定行索引:将
111111
df = pd.read_csv(r'D:\data.csv', encoding='utf-8', dtype={'col':str}) #指定某一列格式
112112
df = pd.read_csv(r'C:\Users\文\data.csv', encoding='utf-8', engine='python') #路径包含中文
113113
df = pd.read_csv(r'D:\data.csv', sep=',') #指明分隔符号
114+
df = pd.read_csv(r'D:\data.csv', header=None, error_bad_lines=False) #无列名,并跳过错误的行
114115
df = pd.read_csv(r'D:\big_data.csv', \
115116
skiprows = lambda x: x>0 and np.random.rand()>0.01) #先随机读取1%数据
116117

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /