Questions tagged [python-3.7]

Version of the Python programming language released in June 27, 2018. For issues that are specific to Python 3.7. Use the more generic [python] and [python-3.x] tags where possible.

0
votes
0answers
20 views

How to access csv file from shared folder?

Please give me steps. Shared folder : \Machine_Name\Project\Data Files\Data.csv Thanks in advance.
0
votes
1answer
14 views

How to remove a single number from a list with multiples of that number

As I'm a beginner in coding I wanted to try to find the first three repeated numbers in a list. My problem is that in my code when there is a number repeated three, the code breaks. The usual, ...
0
votes
1answer
16 views

Initialize a variable number of sympy symbols

Whenever you want to work with the python package sympy, a package for symbolic calculation, you need to initialize the variables as x, y, z = symbols('x y z') For my application, the number of ...
2
votes
1answer
29 views

How to use the 'esc' key to end the program at any point/go back to previous menu?

Currently I have a program that opens with a menu, the user can select an option and go to that function. However if at any point the Esc key is pressed it should go back to the previous menu or exit ...
0
votes
1answer
19 views

How can I change an image-plot by select widget?

I want to use a select-widget/slider-widget to change an image-plot. Is there a way to do that? And if "no" what are my options to realize that issue? Here is a short example of what i've done: #...
0
votes
0answers
8 views

IndentationError: unindent does not match any outer indentation level (opencv and python)

File "eye_motion_tracking.py", line 17 _, contours, _= cv2.findContours(skin_ycrcb, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) ...
0
votes
1answer
15 views

`flush` fails when initilized from object

I'm currently running into a permanent while using the flush (or commit as it depends on it) method from SQLAlchemy session under Flask Alchemy The flush part always failed with sqlalchemy.exc....
0
votes
0answers
6 views

The output is being shown according to the else statment only. what is wrong with this program?

on giving start, stop, help as inputs the output is still being shown on the basis of else statement. ` command = "" while True: command == input("> ").lower() if command == "start":`` ...
1
vote
0answers
10 views

Cannot set the Datasetname in a hdf5 file by slicing

I'm trying to store 3 datasets in a hdf5 file by unsing h5py. The name of each dataset is extraced by a slicing but that doesn't work. # First I open a .png image file and convert this image to an ...
0
votes
1answer
15 views

from sklearn.cross_validation import KFold renaming and depreaction of cross_validation

i used in my code from sklearn.cross_validation import KFold and it was working without no issue . now i got error ModuleNotFoundError: No module named 'sklearn.cross_validation' i google it and i ...
0
votes
0answers
8 views

“NoTagError: ID3v2 tag not found” in Stagger using Python

I'm getting this error everytime I try to execute the code. Here's my bunch of code: import os from natsort import natsorted import fnmatch import stagger def find_music(start, extension): for ...
0
votes
1answer
15 views

How can i update the ColumnDataSource by an “selected.on_change()” event?

First, I created a scatter plot out of geogr. coordinates. If i click on one of these circles a second line-plot next to that scatter plot shows further informations depending on what circle i've ...
0
votes
1answer
16 views

modifying list of class items within a function

I have a list of class instances. I want to modify the class variables of the list within a function call. in the below simple example, I can't understand why for the first item in the list, the class ...
0
votes
0answers
8 views

Process >1000 files into pandas.DataFrame line by line

I have >1000 files with 1kHz data, I want to open every file and parse it into a pandas.DataFrame But to do so i need to post process every single line, causing the process to become extremly slow. ...
0
votes
0answers
17 views

PyQt5 Horizontal Scrollbar in QTableWidget not appearing

I have a QTableWidget displaying times for each bus stop from a database, however for some reason in the table, the horizontal scrollbar doesn't appear. I can only scroll by dragging off the table I ...
0
votes
0answers
15 views

I'm trying to import a JSON file into MongoDB using Python. I keep getting “ModuleNotFoundError: No module named 'pymongo'” error

I'm trying to import a JSON file into MongoDB using Python. I already have pymongo installed. I keep getting "ModuleNotFoundError: No module named 'pymongo'" error. import json from pymongo import ...
0
votes
1answer
33 views

Python 3.7 app seems to stop connecting to internet when I use cx_Freeze to turn the app into an executable

I'm trying to create a python app that will check for newer versions of itself on GitHub. The way it checks is by finding a txt file in the repository that has the latest version number on it. My code ...
0
votes
0answers
23 views

Issue with PyQt when turning LineEdit text to integer [duplicate]

It doesn't want to convert self.lineEdit.text() to string using str() Ive tried converting it to string first then to integer. Pyqt5 Python 3.7 import sys from bitmex_limit import long, short from ...
0
votes
1answer
31 views

f-strings giving SyntaxError: invalid syntax?

I'm trying to learn Python and I'm am getting a syntax error message in Sublime text while trying to run this f-string code Code: # print welcome message greeting = 'Hello' name = 'Michael' ...
1
vote
1answer
17 views

QTreeView Data Changed Signal/Slot Implementation?

I am using pyqt5 / python 3.7 / win10 and I have a QTreeView that has only one editable column which can be edited just fine. What I need to do now is tell the the program that the field has been ...
-1
votes
0answers
15 views

how to upload files in restful [on hold]

I want to upload files. This is my code: registerparser = reqparse.RequestParser() registerparser.add_argument('profil', type=werkzeug.datastructures.FileStorage, location='files') def post(self): ...
0
votes
0answers
6 views

How I could be able to input Urdu Nouns in python like وقت while I have a list of such nouns in Excel sheet?

Please guide me about code and how I enter Urdu language nouns as an input data in Python3.7
0
votes
1answer
20 views

Conditional insert in Dynamodb

I am creating a leave tracker app where I want to store the user ID along with the from date and to date. I am using Amazon's DynamoDB as the database, and the user enters a leave through a custom ...
0
votes
0answers
11 views

Only using 20% of CPU after multiprocessing.pool.starmap() in python

The intention of the program is to run through a directory, if a file is an excel spreadsheet it should open it, extract and manipulate some data then move onto the next file. As this is a laborious ...
1
vote
1answer
12 views

dataclasses.asdict() not working as expected

I'm using dataclass and asdict from dataclasses, and I find that asdict doesn't work as I would expect when I introduce inheritance. I use dataclasses to help me create dictionaries from classes so I ...
1
vote
2answers
48 views

How to print a list of lists into a justified tablular format [duplicate]

I want to be able to convert a list of lists (which we can assume that the inner lists are all of equal length) into a justified table using a function. So far I have tried the below but this doesnt ...
-7
votes
0answers
24 views

Can someone help me with this coding question? [on hold]

Given the following code: x={'Name':'John','Age':25,'Siblings':[{'Name':'Jack','Age':22},{'Name':'Jennifer','Age':18},{'Name':'Mike','Age':28}],'Name': 'Jean', 'Age':21} data = json.loads(X) Please ...
2
votes
1answer
29 views

Stopping any loops when the windows 'X' (Close) button is clicked

I have a program which, when the begin button is clicked, it starts printing to the terminal in a loop. Which is fine. But when I close the window the loop continues printing to the terminal. which I ...
0
votes
1answer
30 views

Does slicing create a new unique object or not? Two seemingly conflicting examples with lists [duplicate]

I'm going through a book on Python and they initially introduced list slicing as a way to create a complete copy of a list, not just a reference. However, later in the book an example is given where ...
0
votes
0answers
17 views

In python 3.7+, is it possible to define torch.nn.Module as a dataclass?

I'm under the impression that dataclass automatically generates an init() function that cannot be customised except post_init() method, which add steps after all the member assignment is finished. ...
-1
votes
0answers
17 views

Error in installing Apache Airflow on windows 10

I am trying to install Apache airflow on windows 10. Python already installed on the machine version 3.7.2 Already installed Microsoft Visual C++ I hit the command pip install apache airflow, ...
1
vote
1answer
27 views

ValueError in the first epoch ending of tensorflow training

im trying to read and solve all the francois's "deep learning with python" book (page 253 chapter 7), and there i found this arquitecture import keras from keras import layers from keras.datasets ...
0
votes
0answers
8 views

The result of the operation is inconsistent with the expectation, and it is not felt to perform the task concurrently

I am learning asynchronous and coroutines, and now I have some doubts in the learning process. what's wrong with my code? import asyncio async def check_usability(proxy): print('333333333333333')...
0
votes
2answers
47 views

I want to assign 2 variables at the same time, which are in the function imported from another file

I want to assign 2 variables at the same time, which are in the function imported from another file. THIS IS THIS FUNCTION def counter(init=[0]): init[0] += 1 return init[0] ...
0
votes
1answer
16 views

Ho to fix 'Connection aborted.', OSError(97, 'Address family not supported by protocol' in aws-lambda?

I am creating a new AWS bot that has to connect to an application installed on my local machine in Apache Tomcat Server. I am able to make a request from postman using the URL 'https://localhost:8080/...
0
votes
0answers
16 views

Virtual Environment dosent work with python3.7

I need to upgrade Python from 3.6 to 3.7 on my Django production website. When I create a new venv with python3.7 -m venv venv and install Django in it everything works fine, I can start the ...
0
votes
1answer
32 views

tabulate showing “\n” while printing

I would like to print a table on the terminal and for that I use the tabulate package but I have extra return chariot '\n'. How can I remove them? import pandas as pd from tabulate import tabulate df ...
-1
votes
0answers
20 views

modify values (string) contained in csv files [on hold]

I generated a 3-column csv file. In the third column of the file there are names as in the following example. JohnSmithjohn smith AlbertEinsteinalbert einstein BradPittbrad pitt I would like to ...
3
votes
2answers
35 views

How to use the return statement in a while loop?

In my program, I have a timer function, it uses a while loop. I want it to return the time past from its start while looping, without stopping the function. def timer(): time_ = 0 while True: ...
0
votes
1answer
10 views

Trouble parsing for specific things like created_at, favorite_count, etc using tweepy

I'm currently using Twitter API to search for tweets using tweepy, and I'm trying to parse for specific parts of a tweet like created_at, favorites, retweets, user id, id, and text of the tweet, but ...
0
votes
0answers
10 views

Problem linking boost-python3 with xcode using macos

I wish to use boost-python3 to wrap my C++ code in macos with xcode. I want to use xcode because it is linked to JUCE music packages. I used a simple example taken from the boost tutorial: #include &...
0
votes
1answer
25 views

Pandas in PyCharm: Where does it display the boxplot?

I am making a python script using the PyCharm IDE, and the idea is to display descriptive statistics and a box plot for each group in a DataFrame. The statistics displays, but the boxplot is nowhere ...
0
votes
1answer
29 views

Drag and drop files in Tkinter GUI

I am fairly new to Python and is stuck at a problem. I am using Python 3.7 and intend to add a "drag-and-drop" functionality to my GUI. I have some files that needs to be read, thus i am looking for ...
-1
votes
0answers
4 views

Does the membership operator works fine with strings

When i give the input string as "end" the loop does not break. will the membership operator is applicable for strings too? import re while(1): string = input("enter any string") if(string is ...
0
votes
0answers
17 views

How to fix EnvironmentError: [WinError 31] A device attached to the system is not functioning

Checking/Installing requirements (takes some time on first install)... Collecting git+https://github.com/Rapptz/[email protected] 7c975200d233 (from -r requirements.txt (...
-1
votes
1answer
15 views

WTForms / SQLAlchemy - Can you concatenate display values in SelectField or QuerySelectField

Is is possible to have a WTForm in which a drop down selection box (SelectField or QuerySelectField) displays a concatentated display value? For example, your database may contain: ID=1, FirstName=...
-1
votes
0answers
19 views

Python / tkinter - Text placing pixel perfect possible?

Is it possible with python / tkinter to place text pixel perfect instead of in columns and rows? I am building an application where, on several places on the screen, texts with different lengths have ...
0
votes
3answers
43 views

Range() function change integers (values) in dictionary to objects

I want to have values as integers assigned to keys, but instead of it when I'm generating integers as values, I'm creating an object. This is my code: prices_for_letters = dict.fromkeys(string....
0
votes
0answers
43 views

setPixmap on QLabel doesn't do anything when called repeatedly as child widget

The following two classes are very similar, but their behavior is not the same. The second works in the obvious way: each button click presents a new image in the slide show. But the first does not. ...
0
votes
0answers
12 views

python file-like objects: flush after writing before seek(0) and re-read?

I have a need to write a TemporaryFile or SpooledTemporaryFile, rewind it, then read back all the data that was written. My question: Must I flush() the stream before rewinding/re-reading in order ...