Category "python"

Split translation results with pandas in Google Colab

Hi everyone I'm doing a traslation of words in csv/excel files using Google Colab and Pandas here is my code: import pandas as pd from googletrans import Transl

What's the right way to send a multi dimensional array from a python script to a C++ code using NamedPipes?

I have a C++ code that expects a struct with this exact formate to be send to it through a NamedPipe:- struct InputData { const std::array<std::array<fl

What's the right way to send a multi dimensional array from a python script to a C++ code using NamedPipes?

I have a C++ code that expects a struct with this exact formate to be send to it through a NamedPipe:- struct InputData { const std::array<std::array<fl

Pandas DataFrame to PostgresSql (pandas.io.sql.DatabaseError)

Am new to Postgres. Anyone can tell how to have it work? What I want to do is to write Pandas datataframe to PostgreSQL database. I have already created a datab

Moving away from simple regex extraction to NER?

We have a relatively "simple" project from the business: digitize some contracts scan (PDF files) with OCR and extract entities from the text. Entities can be s

Use rows values from a pandas dataframe as new columns label

If I have a pandas dataframe it's possible to get values from a row and use it as a label for a new column? I have something like this: | Team| DateTime| Score

exiting from while true loop using EOFError dose not work exactly as expected

I am trying to solve a simple problem in python and this problem I'm using while true loop and to exit this loop I'm using EOFError or in the terminal using con

Linear Model Predictive Control Optimization Running Slowly

I am attempting to implement linear MPC of a quadrotor in Drake. To start with, I have generated a simple desired trajectory moving only in the z-direction usin

Dynamically create CSV files for each section of a config.ini file

I am working on automating status reports using Python and the Jira API with a config.ini file. My goal is to have a config file where users can supply a jql st

Error when trying to download wxPython on Windows

Completely new to python, running command ‘pip install -U wxPython’ in Command line and this is the error I get: C:\Users\Pikachu>pip install -U

Get key=value pairs from a string with regex

I have a string that looks something like: x = """\ names=['m','c'], \ nmodes=2, \ mus=[[-5.0, -5.0], \ [5.0, 5.0]], \ sigmas=[[1.5, 1.5], [2.1, 2.1]],

Labels -1, 0 and 1 for classification in Tensorflow

I am trying to write a model that outputs a vector of length N consisting of labels -1,0 and 1. Each of the labels depicts one of three decisions for the system

Retrieving swapped token addresses from etherscan using web3js

I am trying to retrieve the token addresses of tokens swapped (and amount of tokens swapped) in a single transaction. I am using the "web3.eth.get_transaction(h

How to add element to array at firestore database? (python)

I need to add some value (val) to existing array in google.cloud.firestore document. I found solution like that: database.collection('collection_name').document

Convert a list of dict of [{str:int}, {str:int}, ... ] to a single dict of {str:int}

Given a data-structure like this: [{'a':1, 'b': 2}, {'c':3 }, {'a':4, 'c':9}, {'d':0}, {'d': 0, 'b':6}] The goal is to parse the data to produce: {'a': 2.5, 'b

Django update bootstrap modal not updating untill refresh

Django bootstrap modal form works when i create new data gets populated and pop up closes automatically without refresh but when updating success message appear

Why does ctypes find my dll but not my function?

I am trying to rewrite an 32bit Matlab-script in Python. For this I need to include a dll, which I am trying to do with ctypes. Somehow the Python script does f

xarray discrete scatter plot: specifying legend/colour order

Plotting a discrete xarray DataArray variable in a Dataset with xr.plot.scatter() yields a legend in which the discrete values are ordered arbitrarily, correspo

how do i convert a .csv file to a .data file?

Does anyone know how to convert a .csv file to a .data or know how to use only half of a .data file like a csv file? I'm trying to achieve a mean Average Positi

xarray discrete scatter plot: specifying legend/colour order

Plotting a discrete xarray DataArray variable in a Dataset with xr.plot.scatter() yields a legend in which the discrete values are ordered arbitrarily, correspo