python - Thresholding a pandas dataframe by column -
i have data collected sensor 6 degrees-of-freedom , trying perform plotting , eventual signal processing tasks on it.
i made pandas dataframe , trying threshold or clip data set based on column "stamp" timestamp value in seconds. far have created dataframe:
headers = ["stamp", "liny1", "linz1", "angy1", "angz1", "linx2", "liny2"] df = pd.read_csv("test2.csv", header=0, names = headers, delimiter = ';') df
which gave me:
i wish threshold data until 18 second mark since after noise. tried using threshold function in pandas i'm not sure if did right. can point out mistake is?
df_thresh = df.clip(lower=none, upper=18)
it sounds want use loc
filter data under 19 seconds.
df.loc[df['stamp'] < 19] # not sure units 'stamp' in. seconds?
for reference, doing if clip data, not believe want:
>>> pd.series(range(16,21)).clip_upper(18) 0 16 1 17 2 18 3 18 4 18 dtype: int64
Comments
Post a Comment