Category "python"

TF-Agents _action_spec: how to define the correct shape for discrete action space?

Scenario 1 My custom environment has the following _action_spec: self._action_spec = array_spec.BoundedArraySpec( shape=(highestIndex+1,), dtype=np.

how to render a json from a dataframe in fastAPI

I have a csv file that i want to render in a fastAPI app. I only managed to render te csv in json format like following: def transform_question_format(csv_file_

How to utilize Yolo on high resolution images 8k

I have recently started working in this field. And currently the requirement is to train Yolov3 on a custom dataset where images are of 8k resolution. Is there

Permission of the API Twitter

I'm making a twitter bot to like tweets and at first the script is right. The problem is with the twitter API permission. It says "Read only" and there is no op

CSRF Exempt Django Auth Password Reset View for Cross Domain request

I have a separate front end and backend site and I am trying to enable users on the front end to reset their password. I have created an endpoint for them to d

how to code a right sibling left child tree

im super stuck on my assignment i have found a code to make a basic version of this tree but i have no idea how its works. Can someone pls help explain how it w

Send SVG image content to email as HTML using boto3

I want to send SVG content (without saved file) as HTML to Outlook email address. This SVG content works fine in browser showing a circle image, however sending

How can I detect an "unClick" in wxPython?

I want to detect the difference of position between when I left-click in a panel and when I finish clicking (when the left button goes up after the click). I de

AttributeError: 'MapDataset' object has no attribute 'client_ids' in tensorflow_federated TFF

I'm trying to test a compression technique in federated learning with non-IID using this API tff.simulation.datasets.build_single_label_dataset(), following the

Robot Framework having trouble evaluating expression with a colon in it

I currently have a conditional statement with two variables in Robot Framework that have a colon(:) in the string. The evaluation fails every time. Both variabl

Disable the output of matplotlib pyplot

I have an array A of shape (1000, 2000). I use matplotlib.pyplot to plot the array, which means 1000 curves, using import matplotlib.pyplot as plt plt(A) Th

How to mark the maximum value and location of 4 equations in one plot (shear diagram - portal frame)?

I´m an mechanical engineering student and I'm trying to make a shear diagram of a portal frame. In the code below I want to identify for each equation (4

Unresolved reference in Manim Community with pycharm

I installed Manim community version 0.14.0 using pip install manim on Windows 10. I used the code example given on installation page and it works fine in pyChar

Plotting nested lists seperately, which are inside nested dictionaries

I have a list consisting of multiple nested dictionaries and nested lists MyList = [{dict0}, {dict1}, {dict2} ... {dict2422}] dict0 = {'type': 'Feature', 'geom

Pandas group by one column and repeat the values of another column

I was trying to divide the month into two weeks. Basically for each month i am trying to create week numbers like 1,2,3,4 and repeat them. How to create the req

Adding new key values in a dictionary that was imported from an CSV file?

Sorry But I can't use pandas. I have a sample input csv file that looks like this: Alfa,Beta,Charlie,Delta,Echo,Foxtrot,Golf,Hotel,India,Juliett,Kilo A1,B1,C1,D

Where does transformers save microsoft/DialoGPT-small?

when I run the code from transformers import AutoModelForCausalLM, AutoTokenizer import torch SML=input("small,medium or large: ").lower()#I pick small model_na

Java Mybatis to Python SQL Alchemy - is there resultMap mybatis equivalent in SQLAlchemy python. which logically maps join queries removing duplicates

Say we have a select query like select a.col1,a.col2,a.col3,b.col1,b,col2,c.col1 from a, b, c where a.col1(+)=b.col2 and b.col3(+)=c.col2 In mybatis xml we hav

Append nanosecond to millisecond Python datetime object

I am trying to append nanoseconds to an already existing millisecond datetime pandas object. So, for instance, I already have 08:02:36.715647 which reports upti

converting a string to dot notation to access value in nested list in python

items={ "fruits": { "summerFruits": { "Mangoes":5, "melo