Questions tagged [filtering]

In signal processing the complete or partial suppression of some aspect of the signal. Or selecting a subset of some set of data.

Filtering is a class of signal processing, the defining feature of filters being the complete or partial suppression of some aspect of the signal. Most often, this means removing some frequencies and not others in order to suppress interfering signals and reduce background noise. However, filters do not exclusively act in the frequency domain; especially in the field of image processing many other targets for filtering exist.

A less abstract application of filtering is when you have a set of data that needs to be refined according to a predetermined filter (which could be specified by a user or constructed programmatically). Applying the filter reduces the set of data, eliminating that which falls outside the bounds of the filter - the resulting filtered set of data could then be shown in the user interface.

6421 questions
522
votes
9 answers

Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()

Having issue filtering my result dataframe with an or condition. I want my result df to extract all column var values that are above 0.25 and below -0.25. This logic below gives me an ambiguous truth value however it work when I split this filtering…
obabs
  • 5,491
  • 3
  • 9
  • 16
386
votes
25 answers

Creating a blurring overlay view

In the Music app of the new iOS, we can see an album cover behind a view that blurs it. How can something like that be accomplished? I've read the documentation, but did not find anything there.
kondratyevdev
  • 3,449
  • 3
  • 10
  • 11
290
votes
7 answers

mongodb/mongoose findMany - find all documents with IDs listed in array

I have an array of _ids and I want to get all docs accordingly, what's the best way to do it ? Something like ... // doesn't work ... of course ... model.find({ '_id' : [ '4ed3ede8844f0f351100000c', '4ed3f117a844e0471100000d', …
ezmilhouse
  • 7,753
  • 6
  • 27
  • 38
249
votes
16 answers

JavaScript: filter() for Objects

ECMAScript 5 has the filter() prototype for Array types, but not Object types, if I understand correctly. How would I implement a filter() for Objects in JavaScript? Let's say I have this object: var foo = { bar: "Yes" }; And I want to write a…
244
votes
17 answers

Detect and exclude outliers in Pandas data frame

I have a pandas data frame with few columns. Now I know that certain rows are outliers based on a certain column value. For instance column 'Vol' has all values around 12xx and one value is 4000 (outlier). Now I would like to exclude those rows…
AMM
  • 12,892
  • 19
  • 61
  • 74
233
votes
1 answer

Django Model - Case-insensitive Query / Filtering

How can I query/filter in Django and ignore the cases of my query-string? I've got something like and like to ignore the case of my_parameter: MyClass.objects.filter(name=my_parameter)
Ron
  • 18,164
  • 27
  • 98
  • 185
219
votes
12 answers

Filtering Pandas DataFrames on dates

I have a Pandas DataFrame with a 'date' column. Now I need to filter out all rows in the DataFrame that have dates outside of the next two months. Essentially, I only need to retain the rows that are within the next two months. What is the best way…
AMM
  • 12,892
  • 19
  • 61
  • 74
187
votes
3 answers

Logical operators for boolean indexing in Pandas

I'm working with boolean index in Pandas. The question is why the statement: a[(a['some_column']==some_number) & (a['some_other_column']==some_other_number)] works fine whereas a[(a['some_column']==some_number) and…
user2988577
  • 2,825
  • 5
  • 19
  • 21
157
votes
9 answers

Filtering collections in C#

I am looking for a very fast way to filter down a collection in C#. I am currently using generic List collections, but am open to using other structures if they perform better. Currently, I am just creating a new List and looping…
Jason Z
  • 12,199
  • 14
  • 47
  • 62
132
votes
8 answers

Is there a way to filter network requests using Google Chrome developer tools?

Is it possible to filter out some requests using Chrome developer tools, say, filter out all image requests?
Adam Lee
  • 21,598
  • 43
  • 138
  • 208
121
votes
11 answers

Datatables - Search Box outside datatable

I'm using DataTables (datatables.net) and I would like my search box to be outside of the table (for example in my header div). Is this possible ?
Athanasios Emmanouilidis
  • 1,890
  • 3
  • 16
  • 24
106
votes
5 answers

filter items in a python dictionary where keys contain a specific string

I'm a C coder developing something in python. I know how to do the following in C (and hence in C-like logic applied to python), but I'm wondering what the 'Python' way of doing it is. I have a dictionary d, and I'd like to operate on a subset of…
memo
  • 3,025
  • 4
  • 25
  • 33
89
votes
11 answers

How to run a SQL query on an Excel table?

I'm trying to create a sub-table from another table of all the last name fields sorted A-Z which have a phone number field that isn't null. I could do this pretty easy with SQL, but I have no clue how to go about running a SQL query within Excel.…
Vap0r
  • 2,418
  • 2
  • 19
  • 35
85
votes
1 answer

Creating lowpass filter in SciPy - understanding methods and units

I am trying to filter a noisy heart rate signal with python. Because heart rates should never be above about 220 beats per minute, I want to filter out all noise above 220 bpm. I converted 220/minute into 3.66666666 Hertz and then converted that…
user3123955
  • 2,299
  • 4
  • 18
  • 21
82
votes
6 answers

How can I filter an ArrayList in Kotlin so I only have elements which match my condition?

I have an array: var month: List = arrayListOf("January", "February", "March") I have to filter the list so I am left with only "January".
Nitt
  • 1,373
  • 2
  • 9
  • 14
1
2 3
99 100