私信  •  关注

Fareed Khan

Fareed Khan 最近创建的主题
Fareed Khan 最近回复了
3 年前
回复了 Fareed Khan 创建的主题 » 使用python根据条件提取数据
# Importing Libraries
import pandas as pd

# Importing dataframe
df = pd.read_csv('mydata.csv')


# Col A Value input as int
first_input = int(input('Enter Col A Value'))

# Col B value input as string
second_input = str(input('Enter Col B Value'))

# checking both column values with == sign 
df[(df['Col_A'] == first_input) & (df['Col_B']== second_input)]