forked from quandl/quandl-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49e8dd1
commit 1b65c57
Showing
1 changed file
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
@@ -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: | ||
|