3.1题
df1 = pd.read_csv('num.text',sep=',header=None)
df1.columns = ['N']
print(df1[df1.N > 0 ].shape[0],df1[df1.N == 0 ].shape[0],df1[df1.N < 0 ].shape[0])
3.2题目
from random import 颂冲randint, seed
seed(8)
output = []
for i in range(100):
穗樱伍output.append(random.randint(10,99))
df2 = pd.Dataframe(output, columns = 猜或['N'])
df2.to_csv('d:\num1.txt')
df2 = pd.read_csv('d:\num1.txt')
df2 = df2.sort_values(by='N')
df2.to_csv('d:\num2.txt')
截图蚂孝嫌闷手慎悄内容