Skip to content
Advertisement

how i can count members in python i need full code

i want to count members in discord but how using async await message.channel.send(f”””# of Members: {id.member_count}”””) i try i know this is copy code my code is Answer To get the amount of members from a guild can be retrieved with member_count, with this you also need to properly define guild or just simply using ctx.guild.member_count This is an example

Appending to empty array in a for loop (python)

How do I append values in an empty numpy array? I have an array of values that I want to perform a mathematical equation on and from those values I want to append it to a new empty array. What I have is: However, it isn’t appending and not sure why? Answer You’re missing the array name, you’re using values_array

Calling tk.Tk() once but unexpectedly get two windows?

I am using python 3.8.5 and tkinter 8.6. I am learning to use tkinter. I was trying to make a simple form but for some reason I get two windows when I run my code. One of these windows has everything I am expecting with all the details I expect, but then there is a second unexepected uncallwed window with

Add counter as an additional column in Python pandas dataframe

I have following dataframe as an output of my python script. I would like to add another column with count per pmid and add the counter to the first row, keeping the other rows. The dataframe looks like this: df Expected out is: How can I achieve this output? Thanks Answer You can add count for each row with groupby().transform:

Advertisement