Skip to content

Commit

Permalink
translate comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MooooCat committed Aug 22, 2024
1 parent ce5b82a commit 974367e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sdgx/data_processors/filter/positive_negative.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@ def reverse_convert(self, processed_data: pd.DataFrame) -> pd.DataFrame:
"""
logger.info(f"Data reverse-converted by PositiveNegativeFilter Start with Shape: {processed_data.shape}.")

# 创建一个布尔掩码,用于标记需要保留的行
# Create a boolean mask to mark the rows that need to be retained
mask = pd.Series(True, index=processed_data.index)

# 检查 positive_columns
# Check positive_columns
for col in self.positive_columns:
if col in processed_data.columns:
mask &= processed_data[col] >= 0

# 检查 negative_columns
# Check negative_columns
for col in self.negative_columns:
if col in processed_data.columns:
mask &= processed_data[col] <= 0

# 应用掩码筛选数据
# Apply the mask to filter the data
filtered_data = processed_data[mask]

logger.info(f"Data reverse-converted by PositiveNegativeFilter with Output Shape: {filtered_data.shape}.")
Expand Down

0 comments on commit 974367e

Please sign in to comment.