Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WING PYTHON IDE HELP!!!!
#1
I keep getting this error on Wing Python IDE.

Error:
Python 3.11.2 (tags/v3.11.2:878ead1, Feb 7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] Type "help", "copyright", "credits" or "license" for more information. [evaluate assignment2.py] Traceback (most recent call last): File "C:\Users\under\OneDrive\Documents\COSC131\assignment2.py", line 180, in <module> wind_data = read_wind_records(wind_filename) builtins.TypeError: _interp_dispatcher() missing 1 required positional argument: 'fp' During handling of the above exception, another exception was raised: Traceback (most recent call last): File "C:\Users\under\OneDrive\Documents\COSC131\assignment2.py", line 1, in <module> # Used internally for debug sandbox under external interpreter File "c:\users\under\appdata\roaming\python\python311\site-packages\numpy\__init__.py", line 152, in <module> from . import random File "c:\users\under\appdata\roaming\python\python311\site-packages\numpy\random\__init__.py", line 180, in <module> from . import _pickle File "c:\users\under\appdata\roaming\python\python311\site-packages\numpy\random\_pickle.py", line 1, in <module> from .mtrand import RandomState File "c:\users\under\appdata\roaming\python\python311\site-packages\numpy\random\mtrand.cp311-win_amd64.pyd", line 1, in init numpy.random.mtrand MZ\000\000\000\000\000\000\000ÿÿ\000\000¸\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000º\000´ Í!¸LÍ!This program cannot be run in DOS mode. File "c:\users\under\appdata\roaming\python\python311\site-packages\numpy\random\bit_generator.cp311-win_amd64.pyd", line 38, in init numpy.random.bit_generator ä@\000H%g\000L‹ÆH‹ ÿ™>\000ëH‹5H\000H‹ÖL‹Fÿ @\000H‹ØH‹Ñ\000H‹HH‰ File "c:\users\under\appdata\local\programs\python\python311\lib\secrets.py", line 2, in <module> print (np.interp([0, 1, 2], [0, 1, 2])) File "<__array_function__ internals>", line 198, in interp builtins.TypeError: interp() missing 1 required positional argument: 'fp'

This is the code I am trying to run.


import numpy as np
def interpolated_efficiencies(turbine_data, speed_readings):
    """takes numpy array of turbine data and speed readings and returns list of effeciencies"""    
    turbine_data = turbine_data[turbine_data[:, 0].argsort()]
    speeds = turbine_data[:, 0]
    efficiencies = turbine_data[:, 1]
    interpolated = np.interp(speed_readings, speeds, efficiencies, left=0, right=0)
    
    return interpolated

The input code is this:

# simple example
turbine_data = np.array([[2, 0],
                         [3, 0.1],
                         [4, 0.2],
                         [5, 0.4],
                         [6, 0.41],
                         [7, 0.3],
                         [8, 0.1]])
speed_readings = np.array([1, 2, 2.9, 3, 3.25, 4.5, 4.6, 5.75, 6.8, 7, 7.7, 8, 9])
efficiencies = interpolated_efficiencies(turbine_data, speed_readings)
np.set_printoptions(precision=4, floatmode='fixed', suppress=True, linewidth=8)
print(efficiencies)
 
It runs and works perfectly, just not in Wing. I am really stuck as to what is wrong.

I have tried updating numpy installation, resetting the shell many times, chatGPT, nothing seems to help.
Gribouillis write Jun-02-2023, 04:40 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
WING PYTHON IDE HELP!!!! - by nma236 - Jun-02-2023, 04:18 AM
RE: WING PYTHON IDE HELP!!!! - by Gribouillis - Jun-02-2023, 04:50 AM
RE: WING PYTHON IDE HELP!!!! - by nma236 - Jun-02-2023, 05:05 AM
RE: WING PYTHON IDE HELP!!!! - by rob101 - Jun-02-2023, 06:39 AM
RE: WING PYTHON IDE HELP!!!! - by nma236 - Jun-02-2023, 11:00 AM
RE: WING PYTHON IDE HELP!!!! - by rob101 - Jun-02-2023, 12:24 PM

Forum Jump:

User Panel Messages

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