How to generate rolling subsequences into a dataframe in Python
I have the following data frame:|col0||----||1 ||2 ||3 ||4 ||5 ||... ||1000|I'd like roll col0 into a data frame with a window size of 5, so the outcome would be like...
View ArticleHow can I integrate real-time weather data into a Python-based digital art...
I'm a digital artist working on a Python-based digital art installation that dynamically changes based on real-time data inputs. Specifically, I'm interested in integrating weather data to influence...
View ArticleHow to randomly sample very large pyArrow dataset
I have a very large arrow dataset (181GB, 30m rows) from the huggingface framework I've been using. I want to randomly sample with replacement 100 rows (20 times), but after looking around, I cannot...
View ArticleHow do I get the current IPython / Jupyter Notebook name
I am trying to obtain the current NoteBook name when running the IPython notebook. I know I can see it at the top of the notebook. What I am after something likecurrentNotebook =...
View Article(Multi processing) Why the code written under "if __name__ == '__main__':"...
Followings is my code:import multiprocessingimport timedef list_function_multiprocessing(setlist, function): from multiprocessing import Pool num_cores = multiprocessing.cpu_count() pool =...
View ArticleGetting the file name of an ipython notebook
For python files I can get the file name and use to as a prefix for the generated results using:prefix = os.path.splitext(os.path.basename(main.__file__))[0]But this fails for ipython notebooks with...
View Articleis there anyway of changing this program to a flet program and also add a...
import datetimedef calculate_period_length(start_date, end_date): period_length = (end_date - start_date).days + 1 return period_lengthdef track_cycle(): cycle_length = 28 last_period_date =...
View Articleinteractive brokers: how to get historical sentiment in python?
IB provides a python library (ib_insync) for accessing the trader workstation and allows to download historical market data as well.However I have not found a way to download historical sentiment...
View ArticleNextflow Execution Environment Differs Between Processes
I am defining two nextflow processes. The first one, scatter(), creates two files. Then, parallel() is spawned twice, once for each file.Here is my setup.// bug.nfnextflow.enable.dsl = 2workflow {...
View ArticleCircular import issue on multiple python files
I'm currently making an arcade-like system game with python. I separated my project into multiple files. gtn.py is responsible for the "Guess the Number" game. startup.py was supposedly used for first...
View ArticleHow do I create an OLS result table?
I want to create an OLS regression result table that display the unemployment rate for females after a natural disaster takes place and another OLS regression result table for males. My issue is that...
View ArticlePython in Nuke: Creating Roto node via pythonpanel script breaking Roto node
I am integrating a tool I made that applies tracking data from a Tracker node to a Roto node. It does this by creating the node, then linking each corresponding value. The tool as a standalone works...
View Articlepython cv2 draw a center curve in a curved object
I want to draw a line across the center of a curved object.As an example: an image of a banana is given, the orientation might change with different images and also there might be more than one curve...
View ArticleAny examples for using patchworklib with matplotlib in a PyQT environment?
Hollo everyone,Currently, I am working on a project that involves matplotlib integrated with pyqt. I intend to combine several figures using patchworklib, but I encountered an issue. Despite my...
View ArticleAdding multiple conditions in a while loop in python
i'm having problems adding these 3 conditions in a while loop, where is the error?n = eval(input("Number: "))i = 0while (i % 3 == 0) and (i % 5 == 0) and (i < n): print(i, end=" ") i = i + 1I want...
View ArticleCan we convert longitude and latitude to cartesian co-ordinates without...
Can I convert from longitude/latitude (x,y) coordinates to cartesian (x,y,z) without having elevation. I have checked some forms discussing converting longitude/latitude into cartesian coordinates, and...
View ArticleMultiply two columns of different dataframes in Python
I have two dataframes (both are datatype float). The first one is called Prices which contains only prices:The second one is called Table_ScenarioPercentages which contains percentages where the prices...
View ArticlePhone call website failing to load individual audio blobs
I'm working on a flask/ quart app that records your voice on one page, stores it in JSON and on the other page it loads the JSON and sends it to the page to load it in. I'm doing this with websockets...
View ArticleWhy does the "initialvel" attribute remain equal to the "vel" attribute...
I am creating a physics engine in python pygame and have recently encountered a problem when trying to reset the velocities and positions of my particles (balls) when pressing r. I did a lot of tests...
View ArticleCapturing Mouse Cursor
I've been trying to capture the mouse cursor and be able to save it as an image or something else to use in an image processing software like openCV later.I've tried libraries in Python online and some...
View Article