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

Change iteritems to items() #16

Merged
merged 1 commit into from
Mar 15, 2024
Merged

Change iteritems to items() #16

merged 1 commit into from
Mar 15, 2024

Conversation

bbimber
Copy link
Contributor

@bbimber bbimber commented Aug 14, 2023

Hello,

We're getting an error with pandas 2.0.3:

2023-08-14T17:16:56.7430548Z [19] "Traceback (most recent call last):"                                                                                                                                                                                               
2023-08-14T17:16:56.7431013Z [20] "  File \"/usr/lib/python3.10/runpy.py\", line 196, in _run_module_as_main"                                                                                                                                                        
2023-08-14T17:16:56.7431467Z [21] "    return _run_code(code, main_globals, None,"                                                                                                                                                                                   
2023-08-14T17:16:56.7431928Z [22] "  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code"                                                                                                                                                                   
2023-08-14T17:16:56.7432357Z [23] "    exec(code, run_globals)"                                                                                                                                                                                                      
2023-08-14T17:16:56.7433028Z [24] "  File \"/home/runner/.local/lib/python3.10/site-packages/demuxEM/__main__.py\", line 13, in <module>"                                                                                                                            
2023-08-14T17:16:56.7433447Z [25] "    main()"                                                                                                                                                                                                                       
2023-08-14T17:16:56.7434101Z [26] "  File \"/home/runner/.local/lib/python3.10/site-packages/demuxEM/__main__.py\", line 9, in main"                                                                                                                                 
2023-08-14T17:16:56.7434523Z [27] "    command.execute()"                                                                                                                                                                                                            
2023-08-14T17:16:56.7435348Z [28] "  File \"/home/runner/.local/lib/python3.10/site-packages/demuxEM/commands/DemuxEM.py\", line 61, in execute"                                                                                                                     
2023-08-14T17:16:56.7435773Z [29] "    run_pipeline("                                                                                                                                                                                                                
2023-08-14T17:16:56.7436450Z [30] "  File \"/home/runner/.local/lib/python3.10/site-packages/demuxEM/pipeline/pipeline.py\", line 94, in run_pipeline"                                                                                                               
2023-08-14T17:16:56.7436931Z [31] "    for name, value in rna_data.obs[\"demux_type\"].value_counts().iteritems():"                                                                                                                                                  
2023-08-14T17:16:56.7437609Z [32] "  File \"/home/runner/.local/lib/python3.10/site-packages/pandas/core/generic.py\", line 5989, in __getattr__"                                                                                                                    
2023-08-14T17:16:56.7438053Z [33] "    return object.__getattribute__(self, name)"                                                                                                                                                                                   
2023-08-14T17:16:56.7438669Z [34] "AttributeError: 'Series' object has no attribute 'iteritems'"  

This is probably due to this change in pandas:

See: pandas-dev/pandas#45321

This PR changes iteritems() or items(), as suggested.

@yihming
Copy link
Member

yihming commented Mar 15, 2024

Hello @bbimber . Apology for my late response. I'll go ahead merging your PR, and set the version threshold for pandas dependency as well.

@yihming yihming self-requested a review March 15, 2024 19:16
@yihming yihming merged commit fce70d4 into lilab-bcb:master Mar 15, 2024
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 this pull request may close these issues.

2 participants