Category "python"

how to read s3 files from apache beam python?

I am using Apache Beam python SDK to read s3 file data. code I am using ip = (pipe | beam.io.ReadFromText("s3://bucket_name/file_path")

Keras CNN, Incompatible shapes: [32,20,20,1] vs. [32,1]

I'm trying to reconstruct in Python the Gradient Transformation Network model in the paper titled : Single Image Super-Resolution Based on Deep Learning and Gra

Python iterating over dataframe based on user input

Im trying to filter the data frame (stops_trips_vehicles) based on user input - specifying hour (departure_time column) and the stop name(stop_name column). Eac

how to pass asc desc as params in python psycopg2 raw sql execution?

i have a sample query template to accept dynamic parameters to execute: ps_conn = psycopg2.connect(...) ps_cursor = ps_conn.cursor() ps_cursor.execute(''' S

How to query logcli in python and store it in a python variable (preferably in json format)

I want to query a logcli query in python and store the output of the logcli query in a python variable. The logcli query is logcli query '{app="events-collector

Read excel file in python using pandas

I am trying to read excel file in pycharm using pandas. I installed the package successfully. My issue is that I am trying to use file location in addition to i

Access local files in Python Jupyter Notebook while connected via SSH using VS Code

I use a Python Jupyter Notebook to access databases on a remote server, connected via SSH (Remote-SSH Extension). When I try pandas.read_csv() I can only access

Problems parsing XML/XLIFF with inline elements

I am trying to parse xliff (XML) variant from SDL Trados translation software, which contains translations, and the "sdlxliff" file I'm parsing looks like this

opencv video window not opening though sucess true and camera opens wbut no video window

Can somebody help me with finding error on the below code? I am working on tutorial Face Detect Attendance system python opencv but cv fails to load camera....

How does one insert statistical annotations (e.g. p-values) into a seaborn figure-level plot (e.g. catplot)?

Goal: Given a seaborn catplot (kind="bar") with multiple rows, grouped bars, and a mapped stripplot, how do I add statistical annotations (p-values). The follow

note: This error originates from a subprocess, and is likely not a problem with pip

while downloading pip install allennlp==1.0.0 allennlp-models==1.0.0 I faced this problem : [6 lines of output] running bdist_wheel run

How to extract a part of a protein sequence in reverse using Python [duplicate]

Suppose I have a list of protein sequences: VLQSDLYTLSSSVTV WKLYSKVKPLLNVAR YNTSLRTMPTMIWTW GVDFYSTITRARFEE I want to extract only the last 4

Join two pyarrow tables

I have orc with data as after. Table A: Name age school address phone tony 12 havard UUU 666 tommy 13 abc

replace the empty value in the dataframe with a list of python values

There is a list of shops |Shop ID| |-------| | Shop1 | | Shop2 | | Shop3 | There is a list of events that took place in the store |Shop ID| Event | Start_date

Problem in running PYMC3 - I cannot do sampling and get the trace results

I am a new learner in PYMC3 and I installed the package recently and i tried to run a sample example from the pcmc3 avilbale examples which is this one: Binomia

Call async function in Enum

I want to refactor my code from sync to async. I use Python and FastAPI. I use the method which calls async function in Enumaration. For example: from enum impo

Pytest cannot find function defined in Lambda Layer

I recently added a Lambda Layer to one of my work projects and while it's been a huge success in almost every way, I'm having issues running my tests now. This

AttributeError: The vocab attribute was removed from KeyedVector in Gensim 4.0.0

AttributeError Traceback (most recent call last) ~/Desktop/implimentaion/train.py in 31 use_w2v = True 32 ---> 33 train_df, embed

JSONDecodeError while trying to post csv value via python's requests.put method

I am currently working in python's requests library and accessing Salesforce API. I have successfully Accessed the access_token from Salesforce API Obtained the

RuntimeError: __class__ not set defining 'AbstractBaseUser'

Django app works fine local, but when pushed to heroku build works, but deploy fails: RuntimeError: __class__ not set defining 'AbstractBaseUser' as <class '