Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
Advice
0 votes
6 replies
38 views

I'm new to Python and I'm trying to write a script that removes all even numbers from a list. My logic was to loop through the list and, if a number is divisible by 2, remove it. Here is my code: ...
Yevhen Ivashchenko's user avatar
-5 votes
0 answers
47 views

The problem is that the browser does't open at all. My code is all right here if it expires, please let me know and I'll renew it:https://ctxt.io/2/AAD4b3sxEw
Mohamed Ali's user avatar
0 votes
0 answers
46 views

I have this Python function: import numpy as np def f(x): print(f"x is {x} and has type {type(x)}") try: print(f"x.dtype is {x.dtype}") except AttributeError: ...
zabop's user avatar
  • 8,252
Advice
0 votes
6 replies
77 views

I am completely new to Python and coding in general. I am currently taking a college-level online Python course, but the instructions and book (Zybooks) are proving to be difficult for me to follow. ...
Carl32100's user avatar
2 votes
0 answers
70 views

I am reading about Numerical promotion in numpy. I copy the main graph here: Based on the graph, this explanation: The input dtype with the higher kind determines the kind of the result dtype. The ...
zabop's user avatar
  • 8,252
-3 votes
1 answer
48 views

i need some help to a problem that makes no sense to me. my code goes like this: from file1 import* def func1(): var_from_file1 = anything def func2(): var_from_file1 = anything #exact same ...
Mathys's user avatar
  • 1
1 vote
1 answer
65 views

These two lines: res0 = np.array(np.uint8(40))-80 # np.uint8(216), no warning res1 = np.uint8(40)-80 # np.uint8(216), warning seem to work identically. Both res0 and res1 will be np.uint8(216). np....
zabop's user avatar
  • 8,252
2 votes
2 answers
55 views

I know that 1.0 * (40-80) results in -40.0. I understand that 1.0 * (np.array([np.uint8(40)])-80) results in array([216.]). So, it is also not surprising that: import numpy as np C = 1.0 def f(x): ...
zabop's user avatar
  • 8,252
2 votes
1 answer
26 views

i am learning fastapi and i structure an app like this app in FastAPI: models.py file to hold database and other python important methods routes.py file to hold the routes (URLs) schemas.py file to ...
eng.ragy's user avatar
Advice
0 votes
1 replies
32 views

Something I never realized about ttk styles.. You can apparently add custom options to them for whatever purpose you want. My question is... is this against any best practices? Here's a simple example:...
trandolph's user avatar
Advice
0 votes
7 replies
51 views

Apologies if this question has been asked before but I have searched all over the internet and Stack and I can't seem to find a comparable question or explanation. I'm working in Pandas specifically, ...
beri's user avatar
  • 89
0 votes
0 answers
34 views

When I use Pycharm's debugger and I inspect a dictionary in the debug window, if there are characters in the dictionary which are somewhat unusual, (Greek, for example), sometimes the debugger will ...
logic1976's user avatar
  • 591
4 votes
2 answers
95 views

I am looking into numpy.vectorize. I define a function f, which takes an input, prints hi {input}, and returns the input unmodified. import numpy as np def f(x): print(f"hi {x}") ...
zabop's user avatar
  • 8,252
-1 votes
0 answers
52 views

I am currently working on idea to build a program with Python that randomly is picking of items, but in balanced way. I have some ideas how to approach this challenge but I was curious what Stack ...
erotski's user avatar
  • 45
1 vote
1 answer
44 views

i have working on ipynb file, and in a cell i calling custom method from my custom library called mymodule. That method calling np.polyfit() which are import in first line of mymodule import numpy as ...
Hello 123's user avatar

15 30 50 per page
1
2 3 4 5
147148