DataFrame在某一列中取符合条件的值,实例为在时间列中取出小于10的值。
import numpy as np
import pandas as pd
df = pd.read_csv(r'C:/Users/hanhan/PycharmProjects/pythonProject/data.csv',encoding = 'gbk')
t = np.array(df['时间'])
print('初始值的t=',t)
t = np.array(df[df['时间']<10]['时间'])
print('筛选后的t=',t)