Categories
Mastering Development

Saving multiple csv files with diferent names that change dependent on variable value – python

first time asking something here, although I have been using this quite a bit and its been really helpfull. I have already search for it but I cannot find an answer. My program will be constainly receiving car data and I want to save it to multiple csv files. I want to save for every […]

Categories
Development

Searching for a word within a dataframe column

I have the following datadrame: import pandas as pd df = pd.DataFrame({‘Id_email’: [1, 2, 3, 4], ‘Word’: [‘_ SENSOR 12’, ‘new_SEN041’, ‘engine’, ‘sens 12’], ‘Date’: [‘2018-01-05’, ‘2018-01-06’, ‘2017-01-06’, ‘2018-01-05′]}) print(df) I would like to scroll through the ‘Word’ column looking for derivatives of the word Sensor. If I found it I wanted to fill the […]

Categories
Development

Regexp or algorithm in js to get tokens from a string [closed]

I need to tokenize a string representing an item in inventory in javascript getting words and numbers, for example: Given the string ‘Plane Engine 50×60’ the tokens should be [‘Plane’,’Engine’,’50’,’x’,’60’] Given the string ‘Car wheel 220v’ the tokens should be [‘Car’,’wheel’,’220′,’v’] The solution could be a RegExp or a Javascript Algorithm All the items have […]

Categories
Development

Who waits in celery apply_async(countdown=10)

I run celery worker with concurrency 20 “-c”, “20”, “-P”, “eventlet”, “-Ofair” And generate packs of 20 task for this worker queue in another task async_call.apply_async( (call_id, engine), expires=60, countdown=60*random(), # random delay, to prevent spikes ) In flower viewer i see that there are no more than 20 task. Question is: who waiting the […]

Categories
Database Development Python

How to send dataframe from Python to Sql database faster?

I have a dataframe containing almost 10 columns 10million rows. I am trying to send it to the database and i am using this code below. It is so slow it takes 2-3 hours to send it. Can you help me to find a faster way and how to impose it. Executemany or converting it […]

Categories
Development MySQL

Performing arithmetic operations on given columns data in Pandas using Flask

To retrieve database values of the particular row back into the template (webpage) by doing some calculations. But I don’t know how to get particular values from an SQL table and perform calculations. So for this purpose, I tried Flask along with Pandas. I stored some data in MySQL tables and was able to retrieve […]

Categories
Development

How do you substitute a variable in the “instanceof” function

I have the following classes in my java project Wheels, Engine, Brake which all implement CarPart Objects created are stored in an ArrayList<CarPart> parts variable. I want to check three things: Does my car have any Wheels? Does my car have any Engine? Does my car have any Brake? I can write the hasWheels function, […]

Categories
Development

fork/pipes and running multiple programs

I’ve written a engine for the game “draughts” some time ago and now I want to write a program that communicates with two of those engines via some protocol. In the end I hope to have something similar to the UCI-protocol which is widely known among programmers of chess engines. The engine is supposed to […]

Categories
Development

is there a way of passing data in 1 form with 2 tabs?

I’m having an issue with a form I made that saves a new created product data and adds it to the project. But data is getting erased! Whenever I switch tabs the previous TextFormField data gets deleted. Is there a possible way of connecting the 2 tabs into 1? eventho The form is above them […]