Haskell filter operation with modulo

I'm trying to use the "filter" from Haskell but I've got stuck. I wanna use the filter and modulo together in one function like this multipleOf7 :: [Int] -> [Int] multipleOf7 x = filter (test) x where test = x mod 7 == 0 I also tried to us...
more »

2017-05-11 11:05 (3) Answers

Referencing ROW_NUMBER() in WHERE

Having a query that results in over 500K results. What I want to do is split these up by 100K results. I created a row number column to help with that, but now that I'm referencing it in my WHERE it will not process the function and keep getting th...
more »

2017-05-01 20:05 (2) Answers

Haskell own instance typeclass

I need to declare my own typeclass but I dont understand why there is the (==). data Egg = Soft | Hard instance Eq Egg where (==) I did not find anything where the (==) is used in an instance, only in a class ...
more »

2017-03-24 14:03 (2) Answers

Efficient repeated numpy.where

I have a code in which I want to check whether pairs of coordinates fall into certain rectangles. However, there are many rectangles and i am not sure how to generalize the following code to many rectangles. I only can do it using eval in a loop but ...
more »

2017-03-22 17:03 (3) Answers

Can I use an or ( || ) in a where clause?

I am trying to extend the Array type, but I only want the functions available if the type is Int or Float. I know I can do this for one type: extension Sequence where Iterator.Element == Int { } But can I do it for multiple types? This is sort of...
more »

2017-02-27 18:02 (1) Answers

SQL query Where Between two input

I am trying to make a search box but I am facing an issue. Here's the query i am using, I am getting the search query from database,But query is not taking the Fiyat(price),meterekare,odasayisi values from database My question is that Why I am unabl...
more »

2017-01-06 22:01 (0) Answers

Where() method in Pandas with other a Pd.Series

I am experimenting with the where() method in pandas. I run the simple example in the documentation page with other being a pd.Series and I got NaNs which I can not explain: The example dataframe is: df = pd.DataFrame(np.arange(10).reshape(-1, 2),...
more »

2017-01-06 11:01 (1) Answers

Python Pandas Concat "WHERE" a Condition is met

How can I "concat" a specific column from many Python Pandas dataframes, WHERE another column in each of the many dataframes meets a certain condition (colloquially termed condition "X" here). In SQL this would be simple using JOIN clause with WHERE...
more »

2016-10-16 02:10 (1) Answers