Skip to content

Commit

Permalink
multisets limit handled correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisStevens committed Nov 27, 2013
1 parent 49e8dd1 commit 1b65c57
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Quandl/Quandl.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ def get(dataset, **kwargs):
if returns == 'numpy':
try:
u = urlopen(url)
array = genfromtxt(u, names=True, delimiter=',', dtype=None)
try:
array = genfromtxt(u, names=True, delimiter=',', dtype=None)
except ValueError as e:
error = "Currently we only support multisets with up to 100 columns. Please contact [email protected] if this is a problem."
raise Exception(error)

return array

#Errors
except IOError as e:
print("url:", url)
Expand All @@ -120,8 +124,14 @@ def get(dataset, **kwargs):
else: # assume pandas is requested
try:
urldata = _download(url)
print("Returning Dataframe for ", dataset)
return urldata

if urldata.columns.size > 100:
error = "Currently we only support multisets with up to 100 columns. Please contact [email protected] if this is a problem."
raise Exception(error)
else:
print("Returning Dataframe for ", dataset)
return urldata


#Error catching
except HTTPError as e:
Expand Down

0 comments on commit 1b65c57

Please sign in to comment.