Category "python-3.x"

df.to_parquet() | Can I get .parq Bytes from Dataframe?

Goal: Get the Bytes of df.to_parquet() for upload. I attempted: import pandas as pd import io df = pd.DataFrame({'A': [1, 2, 3, 4, 5], 'B':

Sending Cisco commands from a text file using Netmiko fails. send_config_set works but send_config_from_file doesn't

I have been using this link as guide. https://pyneng.readthedocs.io/en/latest/book/18_ssh_telnet/netmiko.html#:~:text=Netmiko%20is%20a%20module%20that,pip%20ins

returning the highest value in the key : value pair in a dictionary [duplicate]

I'm in need of some assistance in this code problem from a MOOC on python programming that I'm taking. This is just for self-learning, and not

win43.client restrict combining many filters

I'm trying to read outlook emails via python, have code like below: import win32com.client import os from datetime import datetime, tim

facing issues in connecting to Teradata via python using teradatasql Module

Code: import teradatasql ExecutionContext = teradatasql.connect (host="xxxx", user="xxxx", password="xxx") def select(exec_context: ExecutionContext): try

How to change URL for beautifulsoup scraper every time the program runs (without doing it manually)?

I have the following code to scrape Reddit usernames: from bs4 import BeautifulSoup from requests import get from fake_useragent import UserAgent

Creating New Columns in Pandas based on subtracting two variables based on value from different indexes

I have a DateFrame df which contains Open High Low Close Volume and Date data for every minute for the past ten days. **open** high low **close** volume

Python3: Import Module over Package

I'm looking for suggestions to import a module over a package in Python3. I don't have control over the names of the files so changing them is not an option. Ad

How to count a field if value is not null in elasticsearch

I have indexed some documents in ElasticSearch. Short view looks like this: { "tenant_id":"abcd1234" "provider_id":"3456" . . . "doctor_summary"

How to remove constant prefix and suffix character [duplicate]

I have a data frame where numeric data is stored in String with some Prefix character which I need to remove. On top of this it has double quo

How to convert the following R code to Python code

The code drops the columns that are not required from the table: inputData <- inputData[,!(colnames(inputData) %in% c('col1','col2',''))] Need help converti

How to read "Table of Contents" from MS Word Document using win32com client?

Recently i have started working on python and MS word. I tried to update the Table of contents in a .docx document using win32com.client python module(pywin32).

Creating Python Lambda@Edge to access a secret in Secrets Manager

I wrote a python lambda that does basic HTTP auth using a user name and password. I created a simple static website in S3 and the python auth lambda is to be i

Apache Spark Dataframe - Get length of each column

Question: In Apache Spark Dataframe, using Python, how can we get the data type and length of each column? I'm using latest version of python. Using pandas data

Is it possible to run two functions (one running FastAPI - ASGI, and one running Flask - WSGI), in one Azure function App?

Im trying testing if its possible to run two functions in one Azure function app one running FastAPI and the other one running Flask. I tried to specify a diffe

How I can change my ip address with python requests

I write a code for get some data with a fake ip. but my code don't work correctly import requests proxies = {"https://": "https://190.71.22.98:8080",} r = requ

How can I ensure my Python packages are installed in Python 3.10 instead of /Library/Python 3.8?

I have successfully installed Python 3.10. I want to install packages. Pandas, BeautifulSoup4, and requests. I tried to import NumPy but IDE says it doesn't hav

Place ipywidget Dropdown on screen in matplotlib.pyplot axes ax1

When I run this code, the Dropdown is nowhere to be found. How do I make it appear in ax1? (I think I would like to avoid Tkinter.) #!/usr/bin/env python3 #Pla

ModuleNotFoundError: No module named 'hcaptcha'

I am trying to execute a code of mine, but i keep getting the following error: ModuleNotFoundError: No module named 'hcaptcha' When I try installing 'hcaptcha

Python 2to3 command window conversion

I have some long scripts to convert from py2 to py3. Also, I am a beginner and I don't have experience with python. On my computer (windows 10) I have python 27