import pandas as pd
d1 = [[3,"negative",2],[4,"negative",6],[11,"positive",0],[12,"positive",2]]
df1 = pd.DataFrame(d1, columns=["xuhao","result","value"])
print(df1)
print(df1.shape)
print(df1.shape[0])
输出结果
xuhao result value
0 3 negative 2
1 4 negative 6
2 11 positive 0
3 12 positive 2
(4, 3)
4
标签:positive,df1,negative,DataFrame,元组,shape,print From: https://www.cnblogs.com/chaimy/p/17222273.html