“Pandas 示例”版本间的差异
来自iCenter Wiki
(以“ #/usr/bin/python # -*- coding: utf-8 -*- import pandas as np import sys df = np.read_csv("traffic.txt", header=None) for x in range(0,10): df.to_csv("%d...”为内容创建页面) |
|||
第1行: | 第1行: | ||
+ | Pandas使用实例 | ||
#/usr/bin/python | #/usr/bin/python | ||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||
− | + | ||
import pandas as np | import pandas as np | ||
import sys | import sys | ||
− | + | ||
df = np.read_csv("traffic.txt", header=None) | df = np.read_csv("traffic.txt", header=None) | ||
− | + | ||
for x in range(0,10): | for x in range(0,10): | ||
df.to_csv("%d.csv" %x, columns=[x], header=True, index=False) | df.to_csv("%d.csv" %x, columns=[x], header=True, index=False) |
2019年7月12日 (五) 04:20的版本
Pandas使用实例
#/usr/bin/python # -*- coding: utf-8 -*- import pandas as np import sys df = np.read_csv("traffic.txt", header=None) for x in range(0,10): df.to_csv("%d.csv" %x, columns=[x], header=True, index=False)