Category "python"

how to open a text file after opening workbook in openpyxl Python

i have been trying to append some data on my excel sheet using openpyxl and after that append some data in my text file...for some reason it gives me error when

How to generate an equivalent of pandas.DataFrame.describe in bigquery SQL?

In Pandas, you can get an overview of the table (mean, quantiles, count and count of unique values) for all columns by using the following method: pandas.DataFr

How to combine two dataframes into one like this, using pandas and python?

Please see the picture here. I have two data frames and i need to convert it into single one, using merge or concat method and i am unable to do so. Can our com

Why does pyppeteer take such a long time to load a single webpage on AWS Lambda

I am currently trying to crawl MVN Repository using puppeteer on AWS Lambda. However, my test function would run for 15 minutes and proceed to fail after that (

Change an audio file frequency into ultra-sonic sound frequency

I'm trying to change my audio file frequency in Javascript and after a lot of struggle I came to one solution, files are given below but I face one limitation h

Check whether deployed in cloud

I have a python program running in a Docker container. My authentication method depends on whether the container is deployed in GCP or not. Ideally I'd have a f

Selenium getting stuck when looping through pages

I have written code that pulls text from sites and analyses them for readability. However, I sometimes get stuck on sites. Is there any way for me to have my pr

why this line of my code crash the archive?

This part of the code for some reason doesn't allow me to read anything from the file correctly. It's like I delete everything and leave white spaces or somethi

How to combine two dataframes into one like this, using pandas and python?

Please see the picture here. I have two data frames and i need to convert it into single one, using merge or concat method and i am unable to do so. Can our com

Regex for a extracting a string starting with a particular word and ending with a year

INPUT 1: The string is enclosed CASE NO.: Appeal (civil) 648 of 2007 in between. OUTPUT 1: Appeal (civil) 648 of 2007 INPUT 2: The string is enclosed CASE NO.:

why this line of my code crash the archive?

This part of the code for some reason doesn't allow me to read anything from the file correctly. It's like I delete everything and leave white spaces or somethi

Splitting a record into 12 months based on the date in pandas dataframe

I have the data in the below format stored in a pandas dataframe PolicyNumber InceptionDate 1 2017-12-28 00:00:00.0 https://i.stack.imgur.com/pE

How to get correct date format from JSON string in Python?

I am trying to get some data from a JSON url using Python and convert in Pandas PD. Everything is working OK. Only there is a column for date. It is coming weir

How to remove space from number followed by unit or dimensions?

Here is the input string string1 = 0.9% SODIUM CHLORIDE 8290306544 FLUSH 0.9 % SYRINGE 10 ML string2 = 0.9% SODIUM CHLORIDE 8290-3071-44 FLUSH 0.9 % SYRINGE 10

Exception has occurred: NoSuchElementException - iframe will not work

from discord_webhook import DiscordEmbed, DiscordWebhook from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.comm

creating a fuzzer for ftp [duplicate]

I keep getting the error when I try to connect to the ftp server: a bytes like object is required not str #!/usr/bin/python import socket s

Finding the minimum result of a list of results

Is there a code to define / sort through lists?

Apache beam: Reading and transforming multiple data types from single file

Is there a way to read each data type as it is by a PCollection from a CSV file? By default, all the values in a row read by a PCollection are converted into a

Print out a list of prime numbers in python

The question is: print out all numbers from 1 to 1000 that satisfy the two conditions: Those are prime numbers The numbers after being reversed are also prime n

Get the mtime of a symlink and not its target in Python

In Python (and Python2) on macOS, when I use os.path.getmtime('/path/to/a/symlink') I get the modification time of the symlink's target. - How do I get instead