Questions tagged [except]

Used for the MS .NET LINQ Except() method and the Python except keyword for exception handling. Use the tag sql-except for questions related to the SQL operator EXCEPT

This tag is used for two different things:

  1. The Microsoft [.NET] Framework [LINQ] Except() method which produces set differences of two sequences.

  2. The [Python] keyword except used for exception handling.

Please use the tag for questions related to the SQL operator EXCEPT

598 questions
12
votes
3 answers

How to use linq `Except` with multiple properties with different class?

I am trying to learn the Linq/Lambda expressions and was stuck at somewhere. What I was Doing I have created two classes with properties which have some common properties in them. The classes are like(It's test code). class TestA { …
user2745246
  • 304
  • 1
  • 3
  • 14
11
votes
2 answers

What is the analogue of EXCEPT clause in SQL in Pandas?

I have a sample pandas dataframe df: col1 col2 col3 col4 0 a 1.0 2.0 3 1 b NaN NaN 6 2 c NaN 8.0 9 3 d NaN 11.0 12 4 e 13.0 14.0 15 …
im7
  • 653
  • 2
  • 10
  • 28
10
votes
2 answers

Does EXCEPT execute faster than a JOIN when the table columns are the same

To find all the changes between two databases, I am left joining the tables on the pk and using a date_modified field to choose the latest record. Will using EXCEPT increase performance since the tables have the same schema. I would like to rewrite…
Joseph Kiskaden
  • 311
  • 1
  • 2
  • 10
9
votes
4 answers

File Open Function with Try & Except Python 2.7.1

def FileCheck(fn): try: fn=open("TestFile.txt","U") except IOError: print "Error: File does not appear to exist." return 0 I'm trying to make a function that checks to see if a file exists and if…
O.rka
  • 29,847
  • 68
  • 194
  • 309
9
votes
4 answers

Confused about try/except with custom Exception

My code: class AError(Exception): print 'error occur' for i in range(3): try: print '---oo' raise AError except AError: print 'get AError' else: print 'going on' finally: print…
kker neo
  • 133
  • 4
8
votes
5 answers

Python: Multiple try except blocks in one?

Is there a neat way to have multiply commands in the try block so that it basically tries every single line without stopping as soon as one command yields an error? Basically I want to replace this: try: command1 except: pass try: …
user4911943
  • 137
  • 1
  • 1
  • 5
8
votes
1 answer

Python empty list Exception

I have this function: def foo(): a = [] if not a: print "empty" return None else: print "not empty" return a Is there any Exception that do the same? Just to remove the if condition. Something like…
ddepablo
  • 677
  • 1
  • 5
  • 16
8
votes
1 answer

Delphi Exception handling problem with multiple Exception handling blocks

I'm using Delphi Pro 6 on Windows XP with FastMM 4.92 and the JEDI JVCL 3.0. Given the code below, I'm having the following problem: only the first exception handling block gets a valid instance of E. The other blocks match properly with the class…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
8
votes
3 answers

How to insert into a static table using EXCEPT?

I am developing an SSMS 2008 R2 T-sql query. Currently my query looks like: INSERT rd_scs_only_clients SELECT DISTINCT en.clientid_c FROM cd.enrollments en WHERE en.agency_c in ('SCCR','SCRP') AND DATEDIFF(DAY, GETDATE(), startdate_d) >…
salvationishere
  • 3,461
  • 29
  • 104
  • 143
7
votes
3 answers

LINQ Map one type to another

I need to find difference between to sets. Classes ,comprising the sets, are different but have same type of fields. To be able to use Except method ,to take the difference, i want to map one list to another. Can i do this using toList method? if…
mehmet6parmak
  • 4,777
  • 16
  • 50
  • 71
7
votes
4 answers

How to compare to list of date in C#?

I have two list of date. I have to compare both list and find missing date. My first list looks like this: 2015-07-21 2015-07-22 2015-07-23 2015-07-24 2015-07-25 2015-07-26 2015-07-27 My second list looks like this…
Priya
  • 591
  • 1
  • 8
  • 23
7
votes
4 answers

How to remove nested keys from a hash list in Rails

I am now trying for some hours to remove a nested hash key of a hash list. I saw many solution non-nested hashs wich looks like this: sample_hash = {"key1" => "value1", "key2" => "value2"} sample_hash.except("key1") This results in: …
user1367922
  • 209
  • 3
  • 13
6
votes
1 answer

Tensorflow GPU memory error try-except not catching the error

I am trying to run a hyperparameter optimization (using spearmint) on a big network with lots of trainable variables. I am worried that when I try a network with the number of hidden units too large, the Tensorflow will throw a GPU memory error. I…
unknown_jy
  • 757
  • 9
  • 19
6
votes
3 answers

Why does EXCEPT not work? Incorrect Syntax near the Word Except

SELECT SKU FROM PartProductSupplemental EXCEPT SELECT SKU FROM Inventory Why do I get this error: Incorrect Syntax near the Word Except I check on line and syntax is syntactically correct: SELECT ProductID FROM Production.WorkOrder EXCEPT SELECT…
bizness
  • 95
  • 1
  • 1
  • 4
6
votes
1 answer

Laravel Collections - Using Except on multidimensional collection

Is there any method to remove properties from multidimensional collections? e.g I have public function getPossibleAnswersAttribute() { return collect([ [ 'option' => 'A', 'answer' => $this->answer_1, …
owenmelbz
  • 6,180
  • 16
  • 63
  • 113
1
2
3
39 40