Good day to you dear developers from stackoverflow. I am currently recording live-video with my usb webcam on my raspberry Pi with the following code: The code doesn’t work anymore, when I use the cap.set(cv.CAP_PROP_FPS, 15) function and I don’t know what I’ve done wrong. I get the followin…
Tag: python
Preserve formatting during excel file split with python
Hi I’m starting with python and have a question that sounds pretty simple, but at this point I don’t know how to solve it. I have a code for splitting some reports by columns. Unfortunately, I noticed that the format in output files changes during the split compared to the master file. __ Dates fo…
Add ONLY the total values on top of stacked bars in matplotlib
I am working with the following bar plot: And I would like to add only the total amount of each index on top of the bars, like this: However, when I use the following code, I only get parts of the stacks of each bar. I have tried with different varieties of ax.bar_label(ax.containers[0],fontsize=9) but none d…
How to find and replace text in a single cell when using Jupyter extension inside Visual Studio Code
As the title says, how to find and replace text inside a single jupyter cell when using the jupyter extension in Visual Studio Code? I am familiar with ctr+h but that will replace all the occurrences in the entire jupyter notebook file. This is a really important feature for me, as I am using it a lot in jupy…
How to arrange tensorboard’s graphs horizontally in tensorflow 2.x?
I am using the following code, the drawing is arranged vertically, how to change it to horizontal arrangement? I didn’t find it in the homepage of tensorflow. https://www.tensorflow.org/api_docs/python/tf/summary/scalar Answer Use regex expressions as suggested here to align your plots: Start tensorboar…
How to use applymap lambda with two conditions
I’d like to find duplicated rows in a Pandas dataframe. When I use df.duplicated() it returns the following error: TypeError: unhashable type: ‘list’ To resolve this error, I tried the following: However, I receive a new but similar error: “TypeError: unhashable type: ‘dict’̶…
Python large numbers (float and integer)
I am trying to understand the following calculation results. Out[1], Out[2] and Out[3] seem to be related to the limit on precision of floats, and Out[4] may be due to the fact that there is no limit on digits of int. Correct? I wonder if someone can explain them in more detail. Answer To understand why this …
How to ask if a user is a member and if so, display their discounted price and how to add all values up? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago. Improve this question I want to ask the user if they are members and if so, give them a 5% dis…
How to fix not working calculation in dataframe pandas python
hello everyone i have a problem in calculation a data frame in python. i have an equation name is TOC/Total_organic. below is the picture of my equation, code to make new colomns in my data frame, and the result code and result from running the code Answer The problem is that math.log10 cannot handle neither …
Create a dataframe based on 3 linked dataframes using a constraint on cumsum
I do have three dataframes like this: that looks as follows and I would like to create another dataframe using these 3 dataframes that looks as follows: Here is the logic for C1: First, one checks the first value in column C1 in df3 which is an a. Second, one checks in df2 where one first finds the letter det…