Example:保留每一列都大於 3 的每一行。code
輸入:pandas
data: A B C 1 2 3 1 4 5 7 8 9
腳本:import
import pandas as pd df = pd.read_csv('data', header = 0, sep = '\t') df = df[(df > 3).any(1)]
結果:csv
A B C 1 4 5 7 8 9