This question is based on the solution of an other question the user user4446237 asked: Updating pandas to version 0.19 in Azure ML Studio
I have followed the steps provided in the answer and I also get the information at the end, that I have imported the new version of pandas (0.23.3) instead of pandas (0.18.0). However after retrieving the version of the packages the code runs into an error:
Caught exception while executing function: Traceback (most recent call last):
File "C:\server\invokepy.py", line 192, in batch
idfs = [parameter for infile in infiles
File "C:\server\invokepy.py", line 194, in <listcomp>
infile, is_buffer=False)]
File "C:\server\XDRReader\xdrutils.py", line 47, in XDRToPyObjects
return XDRBridge.xdr_to_py_positional(attrList)
File "C:\server\XDRReader\xdrbridge.py", line 216, in xdr_to_py_positional
retList.append(XDRBridge.xdrobject_to_dataframe(key, value))
File "C:\server\XDRReader\xdrbridge.py", line 155, in xdrobject_to_dataframe
}, index=np.arange(len(columns[0].values())), copy=False)
File "C:\pyhome\lib\site-packages\pandas\core\frame.py", line 223, in __init__
mgr = self._init_dict(data, index, columns, dtype=dtype)
File "C:\pyhome\lib\site-packages\pandas\core\frame.py", line 356, in _init_dict
columns = data_names = Index(keys)
File "C:\pyhome\lib\site-packages\pandas\indexes\base.py", line 129, in __new__
from .range import RangeIndex
SystemError: Parent module 'pandas.indexes' not loaded, cannot perform relative import
The code I am using is pretty much the same from Jay Gong:
import sys
import pandas as pd
print(pd.__version__)
del sys.modules['pandas']
del sys.modules['numpy']
del sys.modules['pytz']
del sys.modules['six']
del sys.modules['dateutil']
sys.path.insert(0, '.\\Script Bundle')
for td in [m for m in sys.modules if m.startswith('pandas.') or m.startswith('numpy.') or m.startswith('pytz.') or m.startswith('dateutil.') or m.startswith('six.')]:
del sys.modules[td]
import pandas as pd
print(pd.__version__)
# The entry point function can contain up to two input arguments:
# Param<dataframe1>: a pandas.DataFrame
# Param<dataframe2>: a pandas.DataFrame
def azureml_main(dataframe1 = None, dataframe2 = None):
Is there anything I can do about this problem or am I reaching the limitations of Azure ML Studio's Python Script Module.