Skip to content

Commit

Permalink
REF: reduce for combining mask pair-wise
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanovmg committed Oct 4, 2020
1 parent c80b2d3 commit 65996e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from contextlib import suppress
import copy
from datetime import date, tzinfo
from functools import reduce
import itertools
import os
import re
Expand Down Expand Up @@ -4297,9 +4298,8 @@ def write_data(self, chunksize: Optional[int], dropna: bool = False):

# consolidate masks
if len(masks):
mask = masks[0]
for m in masks[1:]:
mask = mask & m
combine_masks = lambda first, second: first & second
mask = reduce(combine_masks, masks)
mask = mask.ravel()
else:
mask = None
Expand Down

0 comments on commit 65996e6

Please sign in to comment.