Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gde-core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Dynamic ExposureDynamic Exposure
  • Global Dynamic ExposureGlobal Dynamic Exposure
  • gde-core
  • Merge requests
  • !25

Suppressed Pandas SettingWithCopyWarning

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Cecilia Nievas requested to merge fix/pandas_warning_view_copy into master Jun 16, 2022
  • Overview 1
  • Commits 1
  • Pipelines 2
  • Changes 1

I searched for and tried out alternative ways of coding GDEProcessor._recalculate_building_classes_proportions() to avoid this warning from Pandas:

  /home/cnievas/Documents/GFZ_local/GDE/00_repos/gde-core/gdecore/processor.py:698: SettingWithCopyWarning: 
  A value is trying to be set on a copy of a slice from a DataFrame.
  Try using .loc[row_indexer,col_indexer] = value instead
  
  See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

but nothing worked. I am suppressing the warning with this MR, otherwise it contaminates the on-screen output and makes it difficult to follow what is going on in the run. This could be refactored in the future, if a solution is found.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/pandas_warning_view_copy