Skip to content

Fix FutureWarning: use Series.iloc[0] instead of Series[0]#86

Merged
wdecoster merged 2 commits intomasterfrom
copilot/fix-future-warning-in-nanocomp
Nov 27, 2025
Merged

Fix FutureWarning: use Series.iloc[0] instead of Series[0]#86
wdecoster merged 2 commits intomasterfrom
copilot/fix-future-warning-in-nanocomp

Conversation

Copy link
Contributor

Copilot AI commented Nov 27, 2025

Fixes pandas FutureWarning about Series.__getitem__ treating integer keys as positions being deprecated.

  • Use .iloc[0] for explicit positional access in stats2html()
# Before
num = len(values[0]) or 1

# After
num = len(values.iloc[0]) or 1
Original prompt

This section details on the original issue you should resolve

<issue_title>Future issue warning</issue_title>
<issue_description>Wasn't sure if this was reported before but I was running NanoComp (just downloaded via bioconda) and got this future issue warning:

< /home/user/miniconda3/lib/python3.13/site-packages/nanocomp/utils.py:33: FutureWarning:

Series.getitem treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use ser.iloc[pos] >

It seemed like this was an error with NanoComp itself so thought I would report it. Thanks and the Nano tools are awesome!!</issue_description>

<agent_instructions>this is just a warning, but would be good to solve regardless</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: wdecoster <11660522+wdecoster@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix future warning in NanoComp utils Fix FutureWarning: use Series.iloc[0] instead of Series[0] Nov 27, 2025
Copilot AI requested a review from wdecoster November 27, 2025 15:11
@wdecoster wdecoster marked this pull request as ready for review November 27, 2025 21:44
@wdecoster wdecoster merged commit 3e2d906 into master Nov 27, 2025
1 check passed
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.

Future issue warning

2 participants