hydroshare / hydroshare-jupyterhub

The HydroShare Jupyterhub Notebook Server is an environment designed provide added value to existing HydroShare resources via interactive computational notebooks.
4 stars 6 forks source link

Ulmo and Pandas incompatible on JupyterHub #127

Open aphelionz opened 5 years ago

aphelionz commented 5 years ago

From: https://github.com/hydroshare/hydroshare/issues/2877

@miguelcleon writes:

I'm trying to run a JupyterNotebook on the CUAHSI JupyterHub the resource is here . The version of Pandas and Ulmo do not work together I get a warning:

/opt/conda/envs/python2/lib/python2.7/site-packages/ulmo/twc/kbdi/core.py:20: FutureWarning: pandas.tslib is deprecated and will be removed in a future version. You can access Timestamp as pandas.Timestamp CSV_SWITCHOVER = pandas.tslib.Timestamp('2016-10-01')

and an error:


`AttributeErrorTraceback (most recent call last)
<ipython-input-4-b758f7901a7d> in <module>()
      3 # read daily mean discharge data from cache (statistics code 00003)
      4 #Rio Sabana
----> 5 data = nwis.get_site_data('50067000',start='2017-09-01', end='2017-09-30') #, parameter_code='00060:00003')['00060:00003']
      6 
      7 # print(data['value'])

/opt/conda/envs/python2/lib/python2.7/site-packages/ulmo/usgs/nwis/core.pyc in get_site_data(site_code, service, parameter_code, statistic_code, start, end, period, modified_since, input_file, methods, **kwargs)
    250         datetime_formatter = isodate.datetime_isoformat
    251     if start is not None:
--> 252         start_datetime = util.convert_datetime(start)
    253         url_params['startDT'] = datetime_formatter(start_datetime)
    254     if end is not None:

/opt/conda/envs/python2/lib/python2.7/site-packages/ulmo/util/misc.pyc in convert_datetime(datetime)
     50     datetime-like object (datetime.date, datetime.datetime, or pandas.Timestamp)
     51     """
---> 52     return pandas.Timestamp(datetime).to_datetime()
     53 
     54 

AttributeError: 'Timestamp' object has no attribute 'to_datetime'`