python Questions

3

Solved

I have data with below schema. I want all the columns should be in sorted alphabetically. I want it in pyspark data frame. root |-- _id: string (nullable = true) |-- first_name: string (nullable...
Swatow asked 6/9, 2019 at 11:54

9

Solved

Question in Short: How can I use the find and replace option (Ctrl+H) using the Python-pptx module? Example Code: from pptx import Presentation nameOfFile = "NewPowerPoint.pptx" #Replace this wi...
Dehumidify asked 20/6, 2016 at 14:15

4

Solved

I am pretty new to neural networks. I am training a network in tensorflow, but the number of positive examples is much much less than negative examples in my dataset (it is a medical dataset). So,...
Humphries asked 17/11, 2018 at 18:20

3

I have jinja template file with variable names like x.y.z (like java package names). Then I'm using Python envtpl to generate actual config file from jinja template file using envtpl.process_file. ...
Deductible asked 8/2, 2016 at 23:48

4

Solved

My use case I need to know when a (specific) key is pressed and held down. The use case after detection is fairly easy. When the key is released, send a signal to stop the callback (which I know al...
Linoleum asked 20/4, 2021 at 13:0

3

Solved

I am using the Python requests module to send a multi-part HTTP POST request that contains both form-data and a file attachment. The "Content-disposition" header for each multi-part object is set...
Forgery asked 25/8, 2019 at 8:37

4

How to import and read multiple CSV in chunks when we have multiple csv files and total size of all csv is around 20gb? I don't want to use Spark as i want to use a model in SkLearn so I want the ...
Impedimenta asked 4/3, 2019 at 16:38

6

Solved

I'm using the newest version of Visual Studio Code and Python 3.6 (64 bit) on Windows 10. I have the "Python" extension installed (the one made by Microsoft). Every time I try to run a si...
Macule asked 24/9, 2019 at 18:6

5

When I try to install FastAPI. I am using Python 3.10.2, Pycharm. I have already installed build tools which is given by the link. and updated setuptools, wheel and pip using pip install --upgrade...
Merrymaking asked 25/2, 2022 at 13:3

2

Solved

I have array of size (3, 3, 19, 19), which I applied flatten to get array of size 3249. I had to write these values to file along with some other data, so I did following to get the array in strin...
Chinkapin asked 2/7, 2018 at 21:47

5

Solved

I am using xarray for combining multiple netcdf files using xarray.open_mfdataset. But I get the error while running the command, below are the commands and error. nc_all = xarray.open_mfdataset(fi...
Exterritorial asked 5/6, 2023 at 20:50

5

Solved

I created this program to calculate the sha256 or sha512 hash of a given file and digest calculations to hex. It consists of 5 files, 4 are custom modules and 1 is the main. I have two functions in...
Occasionalism asked 6/10 at 6:27

5

Solved

I'm using windows 10 and I got rid of python 3.8 and installed 3.7 as the only python version on my system. When trying to install libraries using pip I now get the error: Fatal error in launcher: ...
Dominy asked 13/8, 2020 at 13:44

4

When trying to run simple python3 code via pycharm, I get following error /Users/slimerski/PycharmProjects/studia/venv/bin/python /Users/slimerski/PycharmProjects/studia/zadania_14.py dyld: Lib...
Mensal asked 18/1, 2020 at 12:17

1

If I have a venv with black==22.12.0 installed and I run pip install --U black then pip will update to the newest version of black. I will see same behavior if black is listed in a requirements.txt...
Verticillate asked 9/4, 2023 at 8:43

3

Solved

I've a Python package package_name which provides a command line application command-line-app-name as console_script: setup.py: setup( ... entry_points={"console_scripts": ["comman...
Taxeme asked 27/10, 2020 at 14:45

4

Solved

I have a simple flask server defined like so: import sys import flask from flask import request app = flask.Flask(__name__) port = 4057 @app.route('/search', methods=['POST']) def search(): re...
Laager asked 12/12, 2017 at 5:55

4

Solved

Python's shutil.copytree is not very flexible; what is the simplest way to add support for ignoring permissions while copying in copytree (without having to re-write its implementation)? Otherwise...
Training asked 20/8, 2009 at 0:51

3

In the Django Rest Framework I would like to post a file, received as an InMemoryUploadedFile, to a different server as soon as it is received. It sounds simple, but the request.post() function do...
Lymanlymann asked 5/7, 2018 at 10:52

5

In - Python, inside the the IDLE, in the File Editor Window, How do you run just a selected single line of code in the script, without having the rest of the lines of the program being runned ?
Loleta asked 10/9, 2015 at 13:32

2

Solved

I have a form wherein I'm trying to insert a static image file in between an if-else loop in HTML. Here's the source code of the template: <!DOCTYPE html> <html> <head> &...
Toothpaste asked 29/6, 2015 at 14:9

8

Solved

I have this issue where I would like to shuffle a list, but only do so slightly. Say, I want only a small number of elements to be moved. Is there a simple way to get this done? Right now the best...
Gettysburg asked 17/6, 2020 at 18:51

4

Solved

I have a function in python 3.x def foo(): """Lorem ipsum for more info, see here"" I want to add a hyperlink to 'here' to point to a web site. How can I do that without i...
Quinte asked 22/7, 2022 at 3:38

4

Solved

Using python, I'd like to accomplish two things: Need to split an ipv6 address and port combination in the format [fec2::10]:80 to fec2::10 and 80. Given an IP address and port combination, I nee...
Jarib asked 20/2, 2014 at 12:55

4

Solved

after setting the objective function and constraints, i use prob.solve() print prob.solution.get_objective_value() actually, I just want to print the objective value, however, it displays a lot ...

© 2022 - 2024 — McMap. All rights reserved.