Category "python"

Calculate eccentricity vector of planetary ring particles

I wish to set-up an initially circular (e=0) system of planetary rings which I can later perturb over time and see how the eccentricity changes. However, my cal

Need to read csv files (when csv file is multiple input files) in Python

I have a school assignment that is asking me to write a program that first reads in the name of an input file and then reads the file using the csv.reader() met

Can we use dataclasses as DTO in AWS python Lambda for nested JSON

I was looking out for a structure like DTO to store data from json in a AWS python Lambda. I came across dataclasses in python and tried it to create simple dto

Why is my Python Subscriber/Publisher node not publishing anything? Thank you

The instructions for the question are below Question report 2.7. You are now ready to make a ROS node to perform real-time extraction of the centroid of the lin

Convert Kitti Labels To yolo format

Trying to convert Kitti label format to Yolo. But after converting the bbox is misplaced. this is kitti bounding box. This is conversion code: def convertToYol

Failing to remove all $ in strings in a dataframe

I'm trying to remove unnecessary values in the strings in my dataframe so I can make them integers and do some math logic on them. The commas, and upward arrows

Ursina player keeps clipping through ground

I am making a 3D game in Ursina. But, if the player falls at a great enough height, it will just clip straight through the plane and fall into the void. I'm gue

Rounding columns in a dataframe with file.dtypes.iteritems()

I'm making a function on rounding decimals, I wrote the following already: for colname, coltype in file.dtypes.iteritems(): if coltype in lst: file[

lambda expresion that return the names of the function from a list that have more then one parameter

I need to make a lambda expresion that return the names of the function from a list that have more then one parameter, I wrote the code below but insted of givi

Export multiple .csv files into .txt files in one go

I have multiple .csv files with different names like ATUL.csv, ISEC.csv, XYZ.csv and so on... Every file has similar data format mentioned below: datetime

How to create linked lists using pydantic so auto-completion doesn't break

I am trying to create a linked list using pydantic. The following code works, but I can't get auto-completion to work. As you can see from the attached screensh

showing image from 4k video

Hi i'm using opencv to read the frame of a 4k video: ret, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.imshow('frame', gray) but it do

Failed to build h5py on mac M1

I am trying to install AlphaFold in a python virtual env. While trying to install dependencies, I get this error: ERROR: Could not find a version that satis

Python C API Py_NewInterpreter() freezes thread when creating new sys.stdin

I am building a Python wrapper for a C++ SDK in Python The app I am building on top of is using a console that is always listening to input on stdin Everything

Python Poetry and Script Entrypoints

Im trying to use Poetry and the scripts option to run a script. Like so: pyproject.toml [tool.poetry.scripts] xyz = "src.cli:main" Folder layout . ζ

Display interactive table

Is it possible in jupyter to display tabular data in some interactive format? So that for example following data A,x,y a,0,0 b,5,2 c,5,3 d,0,3 will be scrollab

How to highlight subrow from DF

I have made a function which add subrows to an initial DF : def AddSubrows(FullDF,DF): OutputDf = pd.DataFrame([]).reset_index(drop=True) for i in range

How to resolve this UnicodeEncodeError while installing eth-brownie on Windows10 with pipx?

I tried to install eth-brownie on a Windows 10 PC running anaconda python. Python version is 3.9x I followed the instructions here; https://eth-brownie.readthed

use "abs" with @ operator in CVXPY

I want to do the absolute operator with CVXPY: abs(A @ x). From here cvxpy objective function error involving MulExpression I understand that I cannot use np.

efficient frontier/stock analyze

Consider the following task. Using a 10-year period I should calculate the portfolio weights in January and then use these weights in February to calculate the