Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.ix indexer should be changed to .loc in parameters.py #130

Open
sum1lim opened this issue Jul 14, 2020 · 1 comment · May be fixed by #132
Open

.ix indexer should be changed to .loc in parameters.py #130

sum1lim opened this issue Jul 14, 2020 · 1 comment · May be fixed by #132

Comments

@sum1lim
Copy link

sum1lim commented Jul 14, 2020

.ix is deprecated since pandas 0.20.0 version release. Therefore, running RVIC parameters command would throw this:

slim@devel2:~/Desktop/hydro_data$ rvic parameters sample_parameter_config.cfg
-->> Could not load xarray!! <<--
INFO:init_logger>> -------------------- INITIALIZED RVIC LOG ------------------
INFO:init_logger>> LOG LEVEL: DEBUG
INFO:init_logger>> Logging To Console: True
INFO:init_logger>> LOG FILE: ./routing/sample/logs/RVIC-20200714-171433.log
INFO:init_logger>> ----------------------------------------------------------

INFO:gen_uh_init>> plots directory is ./routing/sample/plots
INFO:gen_uh_init>> logs directory is ./routing/sample/logs
INFO:gen_uh_init>> params directory is ./routing/sample/params
INFO:gen_uh_init>> inputs directory is ./routing/sample/inputs
INFO:gen_uh_init>> aggregated directory is ./routing/sample/temp/aggregated
INFO:gen_uh_init>> remapped directory is ./routing/sample/temp/remapped
INFO:gen_uh_init>> Opened Pour Points File: ./routing/sample/inputs/sample_pour.txt
ERROR:gen_uh_init>> Error opening pour points file: ./routing/sample/inputs/sample_pour.txt
ERROR:gen_uh_init>> 'DataFrame' object has no attribute 'ix'
Traceback (most recent call last):
  File "/home/slim/.local/lib/python3.7/site-packages/rvic/parameters.py", line 188, in gen_uh_init
    pour_points.ix[i, 'names'] = strip_invalid_char(name)
  File "/home/slim/.local/lib/python3.7/site-packages/pandas/core/generic.py", line 5274, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'ix'
ERROR:write>> Traceback (most recent call last):
ERROR:write>>   File "/home/slim/.local/bin/rvic", line 61, in <module>
ERROR:write>> main()
ERROR:write>>   File "/home/slim/.local/bin/rvic", line 43, in main
ERROR:write>> parameters(args.config_file, numofproc=args.numofproc)
ERROR:write>>   File "/home/slim/.local/lib/python3.7/site-packages/rvic/parameters.py", line 51, in parameters
ERROR:write>> outlets, config_dict, directories = gen_uh_init(config_file)
ERROR:write>>   File "/home/slim/.local/lib/python3.7/site-packages/rvic/parameters.py", line 188, in gen_uh_init
ERROR:write>> pour_points.ix[i, 'names'] = strip_invalid_char(name)
ERROR:write>>   File "/home/slim/.local/lib/python3.7/site-packages/pandas/core/generic.py", line 5274, in __getattr__
ERROR:write>> return object.__getattribute__(self, name)
ERROR:write>> AttributeError
ERROR:write>> :
ERROR:write>> 'DataFrame' object has no attribute 'ix'

I suggest replacing .ix to .loc indexer as the pandas doc recommends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant