I have written an API on FastAPI with filename api.py: from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Username(BaseMode
I have the following dataframe: import pandas as pd import numpy as np from numpy import rec, nan df1=pd.DataFrame.from_records(rec.array([(202001L, 2020L, 'app
I need to write a program that returns True/False based on the following conditions: A lowercase 'g' in a string is "happy" if there is another 'g' adjacent to
Based on most of the postings I have read, I need to import winshell in order to create a Windows shortcut using python. But I am running Anaconda python and wh
guys I'm building the web based code editor for my personal project.I want to make it work like VS code but facing some issues. I'm using ACE editor. This is wh
I am trying to code a variant of Dijkstra's shortest path algorithm. In doing that, I want to initialize the shortest path distances to math.inf, and have this
I have a list of dictionary in the following format: ldict = [ {'start_offset': 0, 'end_offset': 10, 'string_type': 'verb'}, {'start_offset': 5, 'end_offset': 1
If I catch a KeyError, how can I tell what lookup failed? def poijson2xml(location_node, POI_JSON): try: man_json = POI_JSON["FastestMan"] woman_json
Recently, I have started to occupy the AWS platform, but when trying to occupy Sagemaker, the following error and I don't know if it is because of Sagemaker or
Trying to compile DAG from Link to AirFlow official documentation Got Airflow dashboard error: Broken DAG: [/ua/sv/airflow/dags/example_mysql.py] Traceback (mos
I have a dataframe as shown below: Col A Time Col B Col C 123 2018-01-06 03:45:23 B 1 141 2018-01-08 12:45:55 C 0 123 2018-01-08 11:45:29 A 0 123 2018-01-08 01
I create this function to update details of user, before this function I have to login and get the token that I have to use in the next call. I use this for ini
Using python 3.10. My issue is I read a jpg file as a binary file and I get a bytes array. I have the following code: from PIL import Image def get_image_bytes
I'm currently trying to scrape some data from Twitter, like username, screen name, the content of the tweet etc. But I've run into some problems: I've been tryi
I modified some scripts to delete all the "delete marker" placeholders from some bucket in s3 but I never found/developed something where I can delete the "dele
I want to start another process, it will start, if I write to telegram bot "start". But right after this occurring the ERROR: 2022-04-11 11:16:13,602 (__init__.
I've got an extremely specific use-case, where I've got multiple folders in a single directory, each of which as subfolders and files, so on and so forth. I nee
The code snippet in Python should convert the rgb image to black and white, but only a black image output. I do not know where the problem is (input and output
please, I am making my own dictionary and cant figure out how to pull translation definitions from google translate. My idea is that python will open my excel f
This data is sanitized. Can someone help me with a way to take this source ip, loop through the dictionary "name", "ipv4_addresses" keys for subkeys "ip" and "