Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Why doesn't Exception Handling work in some cases

$
0
0

@riddhi.luthra wrote:

Statistical Mean doesn’t work in both the cases: blank inputs and string inputs

However, my exception handling only works in one of these:

  1. try:
    print(sts.mean())

except ValueError as ve:
print(type(ve).name,"->",ve)
StatisticsError -> mean requires at least one data point

Exception Handling works successfully here.

  1. But not in the next case:

Can someone help me out here, as to why this happens?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles