2020欧洲杯手机版注册

A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [python]

Python is a multi-paradigm, dynamically typed, multipurpose programming language, designed to be quick (to learn, to use, and to understand), and to enforce a clean and uniform syntax. Two similar but incompatible versions of Python are commonly in use, Python 2.7 and 3.x. For version-specific Python questions, add the [python-2.7] or [python-3.x] tag. When using a Python variant or library (e.g. Jython, PyPy, Pandas, Numpy), please include it in the tags.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

how to split the data in a column based on multiple delimiters, into multiple columns, in pandas

I have a dataframe with only one column named 'ALL_category'. There are multiple names in a row ranging between 1 to 3 and separated by delimiters '|', '||' or '|||', which can be either at the ...
0
votes
0answers
6 views

bad performance using tf dataset cache in an active learning framework

I am trying to build an input pipeline for an active learning application.The script I wrote is loading in the data, augmenting and then caching it.I cache the whole dataset once and then split it ...
0
votes
0answers
10 views

How can I see more information about the failed test cases in the pytest?

import subprocessimport pytest@pytest.mark.parametrize("x", range(19))@pytest.mark.parametrize("y", range(3))def test_fw(x, y): subprocess.call(['fw-test.exe', '--cal_tank', str(x), str(y)...
1
vote
0answers
7 views

How to display in django admin readonly data from other model?

Why when i call instance of model from method car_name the method return - in Django admin.@admin.register(Invoice)class CarProductDataAdmin(admin.ModelAdmin): form = CarProductDataAdminForm ...
0
votes
0answers
11 views

Can't from PIL import Image?

I have tried installing pillow version 7.0.0 and gets the following error below. Please suggestImportError Traceback (most recent call last) in ----> 1 from PIL ...
0
votes
0answers
8 views

PyTorch - custom loss function - calculations outside graph

I'm kinda new to pytorch and trying to wrap my head around it.I've read about custom loss functions and as far as I've seen, they cannot be decoupled from internal computational graph. This means ...
0
votes
0answers
8 views

tkinter:2 windows pop up at the same time

As a beginner, I am not familiar with tkinter and I don't know how to improve the following codes which are supposed to function like this:After running the renamer_v.py file, a window will pop up. ...
0
votes
0answers
6 views

How to process input data for audio classification using CNN with PyTorch?

As an engineer student works towards DSP and ML fields, I am working on an audio classification project with inputs being short clips (4 sec.) of instruments like bass, keyboard, guitar, etc. (NSynth ...
0
votes
1answer
9 views

Python keeps telling me the instance variable doesn't exist in my Screen class

I am trying to access an instance variable in the same class which is self.localIdin my kivy screen and it keeps saying the saying the instance doesn't exist after initialising it. I know I have an ...
0
votes
1answer
15 views

I can't get return super().form_valid(form) to work

I have resolved my issue and provided my solution below.When I create or update a post the changes are saved to the sites database. But after clicking the submit button I get an error message. No ...
0
votes
1answer
20 views

pandas import error when run from command prompt

I dont have any issues when run it through spyder or jupyter
0
votes
1answer
12 views

I am Trying to scrape content from a website but I am getting This error what should I do

I am Trying to scrape content from a website but I am getting This error what should I do Scrape Content from Newtimesdef scrape_newtimes():"""Scrapes content from the NewTimes"""url = 'https:...
-1
votes
3answers
17 views

how to set variable in URL using python [closed]

import requestsimport jsonstart_d = 10r = ('http://comratemodel.azurewebsites.net/calculate?start={start_d}&fetch_size=10&model_type=q0&model_year=2018&type=public')headers = { ...
0
votes
0answers
4 views

3D Voronoi diagram in Python with adjustable cell size/shape

Given a volume (say, some polyhedron), I need to fill it with smaller polyhedra corresponding to a given size distribution, such that the space is filled as much as possible. The smaller polyhedra are ...
0
votes
0answers
13 views

My code works only when the input is below 31 [ProjectEuler100] problem #10-Summation of primes

The problem is from Project Euler100.My code is supposed to find the summation of primes below n.It works fine only when the n is below 31. When n is 32 I still got 129, when n is 2001, I STILL ...

15 30 50 per page