Category "python"

Remove variables from a recarray by variable name

I need to concatenate 2 rec.arrays (same procedure I do for all other in my work). Problem I have is one of the documents I read for the array, has 2 extra vari

Error with delimiters on dataframe when trying to upload it to MSSQL

So I've been trying to upload a dataframe to an specific table that is under MSSQL, I've trying to use the BCPANDAS library to upload the data to it. However th

Turtle No Display Environment Variable in my code

I just started using turtle and I found code online for Sierpinski's Carpet. It should be able to draw the Carpet without problem, but I don't know how to add a

Running the same code yields different results on Colab and on local. No randomization or NN training involved

My code yields different results in the local terminal and on Google Colab. However, if I run the same code on Colab but with a terminal command (i.e. !python t

Issues streaming data from Pub/Sub into BigQuery using Dataflow and Apache Beam (Python)

currently I am facing issues getting my beam pipeline running on Dataflow to write data from Pub/Sub into BigQuery. I've looked through the various steps and al

Cannot import name 'cygrpc' from 'grpc._cython' - Google Ads API

I want to deploy working python project in pycharm to aws lambda. The project is using google-ads library to get some report data from google ads. I tried deplo

How do I turn print into <p>

This is my script: <script> import random import string def get_random_string(length): # choose from all lowercase letter letters = string.prin

Is there any difference between python scripts in airflow and same script in python

I was writing the below code but it is running endless in airflow, but in my system it take 5 min to run gc=pygsheets.authorize(service_account_file='file.json'

Getting errors while trying to decode string with rsa and base64

I'm trying to make a password manager with Python and encrypting the passwords with RSA. that part went smoothly. What's not going smoothly is the decryption. T

Get statistics for each group (such as count, mean, etc) using pandas GroupBy?

I have a data frame df and I use several columns from it to groupby: df['col1','col2','col3','col4'].groupby(['col1','col2']).mean() In the above way I almos

Right outer join with multiple where conditions

I'm having some issues returning any results from my SQL query. I'm pretty sure it's got something to do with the WHERE condition. I want only certain RULE_ID

Initialization of multiple empty lists in Python

What is the correct way to initialize a bunch of variables to independent empty lists in Python 3? >>> (a, b) = ([],)*2 >>> a.append([2,3]) &g

role react bot discord python

I'm trying to create a react role on a message that my bot would have sent, how can I do it? here is my code debut: @bot.command(name = 'role_react_1') async de

"SSL.CERTIFICATE_VERIFY_FAILED: Self signed certificate in certificate chain" in python with PROTOCOL_TLS_CLIENT

This was working fine when I was using PROTOCOL_TLS, but since it's deprecated, I'm trying to switch to PROTOCOL_TLS_CLIENT. The code goes as follows: sslSettin

4D plot surface does'nt display the colors of my 4th dimension

I've been trying de plot 4D figures of aerosols emissions in the atmosphere with X = Longitude, Y = latitude, Z = Injection Heigh of aerosols and cbar = Emissio

Install Python 3 on Centos 8 returns "Failed to synchronize cache for repo 'BaseOS'"

I am using CentOS 8. I'm trying to install Python 3. Command: sudo dnf install python3. Error: Failed to synchronize cache for repo 'BaseOS' How can I fix

How to create a futures limit order together with take profit and stop loss on binance?

I am trying to create a limit order together with take profit and stop loss on binance, but this does not always work. Occasionally this code does everything ri

Indexing 80 million documents to elasticsearch from Django

I am using the latest version of django elasticsearch dsl and I am using the following command to index around 80 million documents: python manage.py search_ind

How to find ast nodes and its sub nodes in Python

I am trying to traverse through ast nodes in Python to fetch value node's Name ids for all Assign Nodes. Ast.walk() method gives me nodes randomly. Assumption

Azure : Unable to view custom logs generated by application

I'm running my flask application container on Azure. I followed this tutorial, I configured logging in my application. But it's not stated as to where to view t