Category "python"

Read .asc data and .dat in Python for project

I have been trying to find a way to read data I found from: https://daac.ornl.gov/cgi-bin/dsviewer.pl?ds_id=1028 I was under the wrong impression I could treat

How do I continue my Python script after a error

I'm trying to make my own OS using: command = input('['+ location + ']$ ') if command == 'exit': break elif command == 'open app': try: app = in

Python pandas - series to dataframe

. How do I print out only the country names that exist in the dataframe among series with country names as index?

convert month of dates into sequence

i want to combine months from years into sequence, for example, i have dataframe like this: stuff_id date 1 2015-02-03 2 2015-03-03 3

How to successfully implement Multiprocessing Lock?

I have been following the example synchronization-between-processes from the multiprocessing document. The script is as follows: from multiprocessing import Pro

Call function at end of for loop is not working as intended

The following code is not working as intended when I call the next() function at end of for loop. For some reason only one item from the list is printed and it

Running a Python Flask server in closed Terminal session

I've made an Flask API Server that i want to run on a Server and close the Terminal session and still keep it running. (SSH) The API's makes a lot of Requests t

What does the percentage sign mean in Python

In the tutorial there is an example for finding prime numbers: >>> for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ...

adding an Icon next to title doesn't work on Mac

I would like to add A LOGO next to Icon but it doesn't seem to work on Mac , any suggestions for [this] code : import sys import os from PyQt5.QtWidgets import

ValueError: Layer weight shape (775, 768) not compatible with provided weight shape (775, 100, 768)

20220422: I've read some tutorials on other embeddings and now I guess my question is actually how to create an embedding matrix using Bert word embeddings? 202

Extract nested values from data frame using python

I've extracted the data from API response and created a dictionary function: def data_from_api(a): dictionary = dict( data = a['number'] ,created_b

Replace null values by the mean of each group

I have a dataset similar to below with several columns which contain Nan values. I would like to group the dataset by location and fill the Nan in Iso code and

Exception: Java gateway process exited before sending its port number

I'm facing an issue when trying to use pyspark=3.1.2. I have java 1.8 installed and added in my user path. But according to the docs it does not need any other

Outputing single strings in python

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 for any graded co

Python-Flask, Server generated from swagger file produces 'do some magic!' for all get methods

I have generated Python Flask-Server API from swagger editor: https://editor.swagger.io/ When I run the server locally, I noticed that all my get methods produc

Pyserial might lose bytes and sometimes won't receive data at all

I'm using PySerial library in order to read 255-byte packets from nRF52 board. But I'm facing some issues: as far as I know it needs 460800 baudrate, but Window

Delete several TwoLineListItem from an MDList when creating a dinamic list without an ids in Kivy

Help here pls, I got to create several TwoLineListItem in an dynamic MDList,This start working when the list (list_general) have an item and this is gotten from

I want to make an calculator for average but i'm facing some issues

I want to make an calculator for average but i'm facing some issues. I want the numbers entered by the users come as a print statement but it is just throwing t

Can not run pyinstaller, as I get enum34 error

I finished a python app, and now I want to packing into an executable, for an end user. I use windows 7 64 bit, and my python version it's Python 3.7.2 I alread

Problem by using for loop when loading data series from .csv file and save them as array matrix for every columns loaded

I want to load a series of data from 6 CSV files and save them per column of the data series. As I call the Column_A, Column_B and new_Column_A, only the last o