oneapi-src / oneapi-src/oneAPI-samples

profile_utils.py:164 causes warning message

Open
#1,368 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
1.2k
Forks
745
PR merge metrics
No merged PRs in 30d

Description

Summary

The profile_utils.py causes following annoying warning messages. Please figure out a way to eliminate it.

profile_utils.py:164: 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
  data['time'] = data['time'].astype(float)

Version

Python 3.10.6
Pandas 1.5.3

Environment

Ubuntu 22.04.1 LTS

Steps to reproduce

python3 profile_utils.py

Observed behavior

The annoying warning messages presented above

Expected behavior

No warning messages presented in the console output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running python3 profile_utils.py <your onednn verbose log file> with the reported Python 3.10.6 and Pandas 1.5.3 versions. Inspect profile_utils.py:164 and reproduce the SettingWithCopyWarning. Done means the command completes without that warning in the console output.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.