Last active
May 4, 2018 06:32
-
-
Save forAllBright/911b2753eb3932c3a77b91fdf4ba00e0 to your computer and use it in GitHub Desktop.
Python DataFrame基本操作 #Python #Pandas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 读取 csv 文件,添加标题行 | |
mobi = r"/Users/pmz/Project/MOBIKE_CUP_2017/225W.csv" | |
df = pd.read_csv(mobi,header=0,names=['time','number']) | |
print(df.head()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#查看 df 的类型详情 | |
df.dtypes | |
#取出两列,转换为二维列表 | |
filter1 = filter1[['time_stamp','hot']] #将 dataframe 转化成二维列表,列表外层元素是一行 | |
lis = np.array(filter1).tolist() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment