Category "python-3.x"

Wrong result of sympy integration with symbol limits

from sympy import * s = Symbol("s") y = Symbol("y") raw_function = 1/(150.0-0.5*y) result = integrate(raw_function, (y, 0, s) The above snippet gets a wrong re

How can i do many things to configure data with keras

I am a beginner learning deep learning by Keras. The ImageDataGenerator class in Keras and the flow_from_directory function made it easy to label images. But al

If statement issue with basic python program [python]

I a new in programming , was trying some concepts with if else in python The if else statement is not working as it should. I'm using nested if-else , however o

Entire Pandas Column Read in as NAN from read_csv()

I'm having trouble reading in my CSV file with Pandas. It's reading in a stock dataset which contains the Date and OHLCV columns, but for some reason, it's read

How to change the default Pydantic error message using FastAPI?

Is there any way to change the default response from Pydantic so that "msg" is "message"? { "detail": [ { "loc": [ "body

Python-TensorFlow app FileNotFoundError: [Errno 2] No such file or directory

I am trying to test a simple Flask-TensorFlow Image Classifier app from docker container. The Docker containers were successfully deployed in an Ubuntu 22.10 EC

How to add widgets while Kivy app is running?

I state that I am not an expert in Python and I started very recently with Kivy! I would like to know if it is possible, and if it makes sense, to add widgets s

Assign values from one list to another list

I have a folder dir_in containing set of files and supplied another list var with possibly variable names for the files. dir_in = 'my_files/data/' contains fi

Cannot import functions in from one directory's subfolder to other pyhton files in same parent directories sub folders. How do I use init.py files

parent_folder / subfolder1 / subsubfolder1/ a.py b.py subsubfolder2/ c.py d.py e.py subfolder2 / subsubfolder2/ f.py g.py subfolder3 / h.py i.py g.py I want to

Python function to iterate each unique column and transform using pyspark

I'm building the following global function in Pyspark to go through each column in my CSV that is in different formats and convert them all to one unique format

Why does column + column concatenation create arrays for some Windows accounts?

When running the below Python code, I get different results depending on the user account/admin privileges that is used. The code is saved as test.py on a Windo

SettingWithCopyWarning Python3

I am finding the max of df2 by row, and setting the max value to new col on df1. df1['max'] = df2[df2.keys().tolist()].max(axis=1) This line is throwing a Sett

find files with similar ID from different folder

I have two folder A and B. in each folder I have text files containing participant IDs starting from 100. some files can be present in both folders. i want to c

AttributeError: 'tuple' object has no attribute 'read' music21 .show()

i have been trying to show a score converted from krn file import music21 as m import os test_data = "D:/Programming/DATA - SCIENCE/deep learning/music gener

Cannot assign "<Invoive: Project>": "Invoive.user" must be a "InvoiveCompany" instance

New in Python code stuffs need a help, Invoices = Parent, Items = Child, I need to add This child items in parent, If i directly save this with the code be

How can I change the color of certain characters using tkinter in python?

I'm coding a brainfuck compiler and im having trouble updating the text color, as I want different symbols to have a different color depending on what they are.

Python Rolling sum for 32 bit vs 64 bit

I am getting strange results when doing rollingSum for 64 bit vs 32 bit precision. Please see the code for display 1 vs 2. Display 1 shows the right rolling sum

F5 SDK - SSL Insecure request

Is there a way to ignore SSL? I'm running Python 3.10.1 code: from f5sdk.bigip import ManagementClient device = ManagementClient('10.10.17.127', user='admin',

How to use a variable/function from a class instance in a differrent class with kivy?

first, I'm new here, so don't hesitate to correct me if I act innapropriatly ! I'm making a sudo turn based RPG combat to train with kivy tools and I've come in

Django customUser models

I have faced two or three issues with django customuser model. The first one being the skills models. I wanted to add the Skills in the custom user, realized th