Python Forum
Questions regarding usage of pandas library
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Questions regarding usage of pandas library
#6
To be clear, this is a comprehension.
[[] for _ in indices]
This is just a for loop where I don't plan to use the index value.
for _ in indices
I could write it like this:
for i in indices
But static analysis tools rightfully complain about assigning values to a variable and then never using the variable. Using "_" as a placeholder for the index variable tells is a way of telling Python you want a loop that executes some number of times and that is all.
Reply


Messages In This Thread
RE: Questions regarding usage of pandas library - by deanhystad - Apr-26-2023, 10:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Better python library to create ER Diagram by using pandas data frames as tables klllmmm 0 1,241 Oct-19-2023, 01:01 PM
Last Post: klllmmm
  Using pandas library ramitaherwahdan1978 5 2,478 Oct-25-2020, 01:46 PM
Last Post: jefsummers
  Library (julian), lack of usage information samsonite 12 7,087 Mar-04-2019, 06:45 AM
Last Post: samsonite
  Discord bot that asks questions and based on response answers or asks more questions absinthium 1 45,784 Nov-25-2017, 06:21 AM
Last Post: heiner55
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,883 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020