Select rows from a DataFrame based on string values in a column in pandas
问题 How to select rows from a DataFrame based on string values in a column in pandas? I just want to display the just States only which are in all CAPS. The states have the total number of cities. import pandas as pd import matplotlib.pyplot as plt %pylab inline d = pd.read_csv("states.csv") print(d) print(df) # States/cities B C D # 0 FL 3 5 6 # 1 Orlando 1 2 3 # 2 Miami 1 1 3 # 3 Jacksonville 1 2 0 # 4 CA 8 3 2 # 5 San diego 3 1 0 # 6 San Francisco 5 2 2 # 7 WA 4 2 1 # 8 Seattle 3 1 0 # 9