Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Problems while trying to download API
Post: RE: Problems while trying to download API

It appears the critical problem is "FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\CZAREK\\AppData\\Local\\Temp\\pip-req-build-9vufm6cc\\setup.py'". Double check the filepath for ...
stullis General Coding Help 4 4,396 Jan-29-2021, 08:47 PM
    Thread: Sum based on conditions
Post: RE: Sum based on conditions

Possibly because it's assignment (=) not evaluation (==). Put a second equal sign in there. Check the slice too, I believe you need a 4 instead of 3.
stullis General Coding Help 3 2,075 Jan-11-2021, 09:02 PM
    Thread: Function won't apply dynamically in timeseries
Post: RE: Function won't apply dynamically in timeseries

The core problem results from the function parameter and the lambda. df['Range'] = df.apply(lambda x: custom_hurst(df), axis=1)The function takes the full dataframe as the argument and the return is ...
stullis General Coding Help 1 1,743 Jan-08-2021, 03:15 PM
    Thread: json function use
Post: RE: json function use

Not sure what the issue is, but I would like to offer some design advice. If you move the file opening out of the functions and use x["data"]["races"][0]["timeseries"] as the argument, you can pare do...
stullis General Coding Help 1 1,407 Nov-25-2020, 03:30 PM
    Thread: random library
Post: RE: random library

Well, by calling random.Choice() on every line, the interpreter is selecting a different element each time. In essence, you have approximately a 3.5% chance of the code ever working. Instead, store th...
stullis General Coding Help 3 1,778 Oct-26-2020, 06:58 PM
    Thread: merging three dictionaries
Post: RE: merging three dictionaries

one = {"A": 0, "B": 0} two = {"C": 1} three = {"D": 3, "E": 0} one.update(**two, **three) print(one)
stullis General Coding Help 3 1,990 Oct-19-2020, 08:37 PM
    Thread: How to grep corresponding value in another df
Post: RE: How to grep corresponding value in another df

Sounds like you want to join the DataFrames. DataFrame.join() operates similarly to a SQL join if you're familiar.
stullis General Coding Help 2 1,859 Oct-13-2020, 02:35 PM
    Thread: Converting list to variables
Post: RE: Converting list to variables

They want a pivot table. pandas.Dataframe has a pivot() method.
stullis General Coding Help 1 1,767 Sep-18-2020, 05:43 PM
    Thread: A Question about Expression
Post: RE: A Question about Expression

Lazy regex "\S+?@" will consume the minimum number of characters until it reaches a white space character or until it reaches a character matching the subsequent character "@". In effect, it will star...
stullis General Coding Help 2 1,686 Aug-14-2020, 04:35 PM
    Thread: If statement help
Post: RE: If statement help

It seems your input isn't matching the conditions. Since there's a space between the question mark and your input and no space after the question mark in the input() string, I'm guessing the input is ...
stullis General Coding Help 2 1,508 Aug-14-2020, 02:38 PM
    Thread: TypeError: a bytes-like object is required, not 'str'
Post: RE: TypeError: a bytes-like object is required, no...

Line 8, socket.send() requires a byte string. There are two changes you can make to do this: Change the string to a byte string with b'': import socket import sys s = socket.socket(socket.AF_INET, so...
stullis General Coding Help 1 2,855 Jul-17-2020, 03:38 PM
    Thread: OOP hellp (simple class person)
Post: RE: OOP hellp (simple class person)

Two problems: There's a typo in the __init__() function signature. You have __init_ instead of __init__. Missing a trailing underscore. When you instantiate p1, you'll need two arguments for Person(...
stullis General Coding Help 4 2,550 Jul-14-2020, 03:28 PM
    Thread: Use of input function to change screen background color in Turtles
Post: RE: Use of input function to change screen backgro...

Quotes make a string. When referencing a variable, do not put it in quotes. wn.bgcolor(screen_color) # No quotes so it uses the value of screen_color, which is a string
stullis General Coding Help 3 4,882 Jul-09-2020, 03:02 PM
    Thread: Whats the difference between these two?
Post: RE: Whats the difference between these two?

A simple example will show the difference. Returning a value means a variable can be instantiated or the value can be used by other functions. Printing merely prints to the standard output. def retur...
stullis Homework 4 3,401 Jul-08-2020, 06:02 PM
    Thread: How to do an ean query?
Post: RE: How to do an ean query?

What have you tried? It looks like a request header you could send with a HTTP request.
stullis General Coding Help 2 1,655 Jul-08-2020, 05:08 PM
    Thread: problem with ‘>’ (i.e. greater than) sign
Post: RE: problem with ‘>’ (i.e. greater than) sign

Why is "ArithmeticError" in there? Post the full traceback for more context.
stullis Homework 2 1,944 Jun-30-2020, 09:31 PM
    Thread: issue in email slicer
Post: RE: issue in email slicer

Well, the problem with the second loop is that it will only work for the character immediately after the "@". There are two better and easier ways to do this. string = "[email protected]" split = ...
stullis General Coding Help 2 1,875 Jun-29-2020, 04:40 PM
    Thread: New user seeking help
Post: RE: New user seeking help

Two things stand out immediately: No data are sent to the csv.write() to write to the file. The file.close() calls at the end are unneeded; the with statement closes them automatically when done. ...
stullis General Coding Help 2 44,419 Jun-22-2020, 09:07 PM
    Thread: Missing 1 required position argument: 'failure' while starting thread.
Post: RE: Missing 1 required position argument: 'failure...

Okay, I looked at it again. There's a problem with the number of parameters and arguments. The args passed to ThreadExecutioner.execute_child() contains six values. The first value is scrape_child_li...
stullis General Coding Help 3 4,109 Jun-19-2020, 02:31 PM
    Thread: Missing 1 required position argument: 'failure' while starting thread.
Post: RE: Missing 1 required position argument: 'failure...

Have you tried passing self as the first argument? I know that seems strange since it's automatic, but passing a method into a thread could disassociated the method and self. If that fixes it, the pro...
stullis General Coding Help 3 4,109 Jun-17-2020, 10:33 PM

User Panel Messages

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