Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Excel isnt working properly after python function is started
Post: RE: Excel isnt working properly after python funct...

When excel executes a Python script, it waits for the script to complete. Your script doesn't complete until the window is closed. This blocks excel from running. There are multiple ways to solve t...
deanhystad General Coding Help 3 237 May-01-2024, 05:20 PM
    Thread: two functions working in a strange way
Post: RE: two functions working in a strange way

You changed the function pi_digits. When running alone, you wrote pi_digits like this: def pi_digits(x): k,a,b,a1,b1 = 2,4,1,12,4 while x > 0: p,q,k = k * k, 2 * k + 1, k + 1 ...
deanhystad General Coding Help 2 201 Apr-30-2024, 10:23 PM
    Thread: Strange behavior list of list
Post: RE: Strange behavior list of list

This makes a list that contains three zeros. All the zeros are the same object. mylist = 3*[0]This makes a list of four lists. All the interior lists are the same object. mylist = 4*[3*[0]]It is exa...
deanhystad General Coding Help 2 200 Apr-30-2024, 05:48 PM
    Thread: PayrollSystem with file handling
Post: RE: PayrollSystem with file handling

You do not save enough information in the csv file. There is no way to differentiate between commissioned and hourly employees. I would save all five employee fields PLUS a field identifying the emp...
deanhystad Homework 1 192 Apr-30-2024, 03:18 PM
    Thread: How can I print from within actor(func) ??
Post: RE: How can I print from within actor(func) ??

def actor(func): def wrapper(*args, **kwargs): gen = func(*args, **kwargs) next(gen) _registry[func.__name__] = gen print(f'key in _registry is {func.__name__}') ...
deanhystad General Coding Help 2 188 Apr-30-2024, 12:25 PM
    Thread: Convert UTC now() to local time to compare to a strptime()
Post: RE: Convert UTC now() to local time to compare to ...

Don't use pytz. Pendulum is a much better time zone library. You can also use the timzone support from the datetime module. Pendulum does not work with 2.7, and datetime added timezone, and I reme...
deanhystad General Coding Help 2 207 Apr-29-2024, 07:24 PM
    Thread: Urgent:help about prediction size
Post: RE: Urgent:help about prediction size

You should compare the values returned by model_fit.predict against the values in test['Mindex']. Maybe that will help you identify the problem. I have no clue. You don't show how you create the mo...
deanhystad Data Science 5 335 Apr-29-2024, 06:25 PM
    Thread: Urgent:help about prediction size
Post: RE: Urgent:help about prediction size

When I look at the plot I see two lines with different x axis values. The number of points looks to be the same.
deanhystad Data Science 5 335 Apr-29-2024, 01:04 PM
    Thread: Urgent:help about prediction size
Post: RE: Urgent:help about prediction size

What makes you think you are not getting the last two predictions?
deanhystad Data Science 5 335 Apr-29-2024, 11:36 AM
    Thread: UART write binary code
Post: RE: UART write binary code

What do you mean by "send binary code"? Do you want to send a binary string (bytes 30 and 31)? That would be b'00001111' or bytes((30, 30, 30, 30, 31, 31, 31, 31)). Do you want to send 15? That wo...
deanhystad General Coding Help 3 262 Apr-28-2024, 04:57 PM
    Thread: Program that calculates buildtime.
Post: RE: Program that calculates buildtime.

I ran your program using the data from you post and get fairly good results when I enter the same data as new data. import pandas as pd from io import StringIO from sklearn.linear_model import LinearR...
deanhystad Data Science 4 217 Apr-27-2024, 09:57 PM
    Thread: ModulNotFoundError matplotlib
Post: RE: ModulNotFoundError matplotlib

You can do "pip list" to see a list of packages installed using pip. There's also no harm in reinstalling. pip install matplotlib should print a lot of stuff Output:c:\projects\bergen>pip install...
deanhystad General Coding Help 9 394 Apr-26-2024, 04:59 PM
    Thread: ModulNotFoundError matplotlib
Post: RE: ModulNotFoundError matplotlib

Quote:I went to matplotlib's website and did a bunch of things that it seemed to be telling me to do to get matplotlib That is not an answer. I don't think you installed matplotlib, at least not the ...
deanhystad General Coding Help 9 394 Apr-26-2024, 04:36 PM
    Thread: using mutable in function defintion as optional paramter
Post: RE: using mutable in function defintion as optiona...

Maybe this makes it more clear. def incorrect(item, quantity, shopping_list={}): shopping_list[item] = shopping_list.get(item, 0) + quantity return shopping_list # Is needed else there is no ...
deanhystad General Coding Help 8 474 Apr-26-2024, 12:52 PM
    Thread: ModulNotFoundError matplotlib
Post: RE: ModulNotFoundError matplotlib

How did you install matplotlib? Import does not install a package.
deanhystad General Coding Help 9 394 Apr-26-2024, 01:14 AM
    Thread: New on python. Needs help with Google sheet
Post: RE: New on python. Needs help with Google sheet

I cannot find where you save your worksheet. Changing the worksheet does not modify the spreadsheet file.. There may be other problems, but start by fixing this so you can see what changes you are m...
deanhystad General Coding Help 1 242 Apr-25-2024, 06:47 PM
    Thread: how to edited Tkinter Toplevel from main form?
Post: RE: how to edited Tkinter Toplevel from main form?

Run the program and press the buttons. The label made in BadWindow appears in the root window.
deanhystad General Coding Help 7 349 Apr-25-2024, 10:16 AM
    Thread: Win or Loss Prediction
Post: RE: Win or Loss Prediction

Can you provide an example of what you tried?
deanhystad General Coding Help 4 316 Apr-24-2024, 07:58 PM
    Thread: watchdog on_modified
Post: RE: watchdog on_modified

Quote:Also, I cannot use the path 'E:/DataLogging/test.xlsx' but I can use 'E:/DataLogging/', which is the directory, and not the specific file. I'm sure there is an easy fix for this, but I cannot fi...
deanhystad General Coding Help 3 289 Apr-24-2024, 06:23 PM
    Thread: how to edited Tkinter Toplevel from main form?
Post: RE: how to edited Tkinter Toplevel from main form?

It doesn't matter if you call Toplevel(), Toplevel(None) or Toplevel(root). The default value for "master" is None. When master is none, the root window is assigned to be the window's master. This ...
deanhystad General Coding Help 7 349 Apr-24-2024, 05:49 PM

User Panel Messages

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