pandas你們用的都不少,像我這種用的不夠熟練,也不夠多的就只能作作筆記,儘可能留下點東西吧。索引
篩選行:pandas
a. 按照列的條件篩選it
df = pandas.DataFrame(...) # supposing it has 3 columns: a, b and cco
df[(df['a'] > 0) & (df['b'] < 0) | df['c'] > 0]
b. 按照索引的條件篩選
needed_seq=[1,2,3,6]
needed_df = df.loc[needed_seq]
篩選列:
a. 篩選多列
dfs = df[['a','b']]