Python/Pandas: Difference between revisions
< Python
Jump to navigation
Jump to search
(Created page with "<source lang="python3"> # Pandas 會自動偵測 extension 解壓縮, 不需要自幹 df = pandas.read_csv(csv_file, skiprows=1, header=None, names=col_names) # print(...") |
No edit summary |
||
| Line 1: | Line 1: | ||
<source lang="python3"> | <source lang="python3"> | ||
df = pandas.read_csv(csv_file, skiprows=1, header=None, names=col_names) | |||
# print(df.head(3)) | |||
# print(df.tail(3)) | |||
for index, row in df.iterrows(): | |||
print(row) | |||
</source> | </source> | ||
Latest revision as of 08:44, 25 September 2019
df = pandas.read_csv(csv_file, skiprows=1, header=None, names=col_names)
# print(df.head(3))
# print(df.tail(3))
for index, row in df.iterrows():
print(row)