Category "python"

AttributeError: 'str' object has no attribute 'player_health' [closed]

today I decided to learn OOP in python and I'm currently playing around with it to understand it a bit, I am trying to make a terminal based

mplcursors with seaborn and multiple dataframes

I am trying to use mplcursors when plotting data from multiple pandas DataFrames (or from multiple subsets of a single DataFrame). I have read the answers of th

Is there a way to turn the sorting in a descending way on the y axis in Plotly? [duplicate]

I've created a program which sorts the highest 50 US airports with the most starts in year 2015 in a bar chart. Unfortunately, the program sho

numerical double integration in Python using dblquad

I am new to Python and was trying to compare the result of numerical double integration in Python with that of Matlab/Octave. For that I followed this exercise:

Unable to download data from Blob storage. Getting 404 returned

I'm using a Python Azure function which gets invoked when I add a blob to a storage container. The function is triggered ok, but I get a 404 response when tryin

Compare two nested dictionaries in python and find records that are not present in the other dictionary

I have written code to extract record information from a folder of old csv files into dictionary A and a folder of new csv files into dictionary B. The dictiona

Seaborn not plotting head but instead plots whole dataframe

I have a dataframe that I groupby() count and then sort_values() by count. I then take the head() and tail() of this dataframe to plot on a seaborn barplot(). H

Decision tree score always return 1

I got 100% score on my test set when trained using decision tree and I think it's a bit strange, given that i set max_depth = 2. And I don't understand that I d

More descriptive error messages for Django Serializers?

I am deserializing JSON data from file to a model object. I'm using a Django Rest Framework serializer. The JSON is quite large and I expected some fields that

How do I find the difference in hours between two time zones?

I have this code here that can find the time in two different timezones at the moment. I want to calculate the difference in hours, between the two timezones. d

Trouble scraping values from url link

I am new to web scraping and am trying to extract a value from Yahoo finance. I am using pandas and match to search for the right row of data amongst the tables

How to get the url of a downloaded file

I have done a lot of research but I can find a way to get the url of a file already downloaded.. I want to get the urls to make a program to sort my files by th

How to use an if statement to break a while loop when the word exit is typed?

I want to make it so that when the word "exit" is typed the loop breaks and it prints a message. How do you do this? This is the code I have so far: file=open("

networkx find egdes in shortest path

Can networkx tell me the edges that a shortest path travelled on? The example below gives me the output [['A', 'C']]. Is there a way to know the path travelle

How to get python bytecode?

I've tried using py_compile to get me some bytecode examples (for learning needs). However, this is what I get file.py: print("hello world") file.pyc: U A

Edit group permissions for members - Telethon

how to change the group permissions in telethon? this permissions will applied to any new member joined the group. you can find this settings in telegram app, i

How can run multiple celery tasks in parallel (by using group)?

I am new to Celery. I want to run demo_task in parallel, but it runs tasks sequentially instead of in parallel. Please let me know if I did something wrong. imp

How to combine winter months that span 2 years?

I have a dataframe p90results that contains daily counts of temperature exceedances from 12/01/1952-12/31/2021. I want to create a plot that sums the daily exc

How to concatenate two columns ignoring NaN?

I have a dataframe: id1 id2 a NaN b c d e I want to create new columns ids as a concatenation of id1 and id2: df.ids = df.id1 + "-" + df.id2

How to import utils from keras_unet

I'm trying to add utils from keras_unet in google colab, but I have a problem. import tensorflow as tfs from keras_unet import utils keras-unet init: TF versio