Skip to content

Tag: python

Turtle graphic not running?

i’m more of a backend web developer and this is for a friend of mine but i have this issue with turtle where her code wont run and i keep getting syntax errors saying certain things aren’t defined. Heres the code Answer If you use import turtle then you have to use turtle.penup(), turtle.setpositi…

Ray has weird time consuming

I have a tiny Ray pipeline like this: I using time.sleep() for fake time consuming. As you can see, the HandDetector should running in a sub process, so the whole time should be 6s. But I got (you can have a try on your computer): Why there are 0.4s time more? Answer It looks like you posted the same question

how to save space training

I have written an intent classification program. This is first trained with training data and then tested with test data. The training process takes a few seconds. What is the best way to save such a training, so that it does not have to be trained again with every call? Is it enough to save train_X and train…

‘str’ object has no attribute ‘to_csv’

I’m trying to save some data that I collected on a csv file. And for that I’m using the following code, but I’m getting the error: ‘str’ object has no attribute ‘to_csv’ I am using this line df = pd.to_numeric(df, errors=’ignore’) to change Nonetype to num…

Replace text at specific position

I am trying to use the replace function to replace specific spans in a text. But it ends up replacing all same strings. prints ‘I played ** times and **4 ***** times’ replacing 13 in 134 too. Is there another way to replace this more accurately? Answer The following does what you want. It creates …