Categories
Mastering Development

pandas: Getting the value of next column, after finding string in multiple columns

How does one get next column, after a string search in multiple columns? My data has a various length of sets as below. I want to find ‘AA’ in ‘n(index)’ column and get the value in ‘v(index)’ which is just next to it. df = pd.DataFrame(columns = [‘n1’, ‘v1’, ‘n2’, ‘v2’, ‘n3’, ‘v3’, ‘n4’, ‘v4’]) […]

Categories
Mastering Development

Nodejs Oracledb executeMany fail to update database

Im am Using oracledb package for NodeJs to perform multiple update in a database by using executeMany(), unfortunately each time i try to update i get the following Error: ORA-01722: invalid number . Data Types from Database: Data Types from Database Sample data Existing in Data base Sample Data Output Error: Error Oracle database Version […]

Categories
Mastering Development

Basic Loop Explanation

I’ve been taking time to go back through and brush up on my python. I have a basic loop I’m looking to create some dialogue for… def simple_loop(a) b = 0 for e in a: e += 15 return b It can be a fairly simple function but I’m just a bit shaky with it […]

Categories
Mastering Development

Group By not working to calculate amount left in MySql

I am trying to calculate the amount of stock left after transactions have been made, however it is returning me a negative amount. What could I be doing wrong with my GROUP BY as it is not seeming to be working or is it the actual calculation (I am a complete beginner as you can […]

Categories
Raspberry Pi User Help

Why is my python script not returning the expected response?

So I am trying to monitor a csv file generated by another python script to check for values greater than 110.0 degrees from temp sensors I have connected to my RPi. The code I’ve developed to do this doesn’t seem to be outputting the expected results. The input file, labeled recent.csv, contains: 72.0, 72.6, 73.2, […]

Categories
Mastering Development

Python: Barplot colored according to a third variable

Currently I am trying to create a Barplot that shows the amount of reviews for an app per week. The bar should however be colored according to a third variable which contains the average rating of the reviews in each week (range: 1 to 5). I followed the instructions of the following post to create […]

Categories
Arduino Ask Engineering

Merging two 2-d arrays in order of axes

Looking to merge two different 2D arrays of different row sizes into one long array: int 2dArray1[][] = { {1, 2, 3}, {4, 5, 6}}; int 2dArray2[][] = { {10, 20}, {30, 40}}; int 1dLongArray[10]; This is where I need help in order to have the values of 1dLongarray be arranged as follows: 1, 2, […]

Categories
Mastering Development

Tidymodels: Unnest the RMSE and RSQ Values for the Best Fitted Model from a TIbble after conducting a 10-fold cross validation in R

Overview I have produced four models using the tidymodels package with the data frame FID (see R-code below): General Linear Model (glm) Bagged Tree Random Forest Boosted Trees The data frame contains three predictors: Year (numeric) Month (Factor) Days (numeric) The dependent variable is Frequency (numeric) Aim My aim is to unnest the best-fitted models […]

Categories
Mastering Development

How to move text inside canvas in Tkinter

I got problem in move the text with respect to mouse cursor inside the canvas. On clicking the text with mouse button 1 and then on dragging the mouse the whole canvas is moved instead of the text inside What should I do to correct this? Here is my code : from tkinter import* import […]

Categories
CMS Mastering Development Wordpress

Need help with Gravity Forms – Custom validation [closed]

I have a form created with gravity forms and I need a custom validation for one of the input fields. In my form there is a quantity count and you should be able to enter value from 10 to 5000, but the field should only accept numbers and those numbers should be multiples of 10. […]