oneapi-src / oneapi-src/oneAPI-samples
profile_utils.py:164 causes warning message
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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