Data dodania Pytanie
2017-10-15 11:10 Converting json like data to csv »
data file looks like the below. Note that the tags and values are not necesirly fixed (i.e. one file may have 10, next 30, 31 etc) { 1=648749...
(0) odpowiedzi
2017-10-13 15:10 Run python kivy application in "kiosk mode" »
I've created a simple python application running in raspbian using kivy. The application runs already nicely in full screen mode. however I would like...
(1) odpowiedzi
2017-10-11 22:10 How to convert \303\255 to "í" in Python? »
I'm using Google Speech API and since i'm using LongRunning functions for wav files, and they're all in pt-BR language, they're returning with content...
(0) odpowiedzi
2017-10-11 03:10 Creating two dimensional list not working as expected »
I am pretty new to Python, and I have tried something similar to what I am trying here before and got the correct output, but in this case my code is ...
(3) odpowiedzi
2017-10-08 12:10 How I can use CMake for linking Python 2 and Python 3 libraries for a same software »
I am developing an IDE with plugins to support Python 2 and Python 3. The build system is CMake. The problem is when CMake looks for Python 2, the Py...
(1) odpowiedzi
2017-10-07 04:10 Python SyntaxError: invalid syntax, are brackets allowed in function parameters in python3? »
The function works in python2: def setCellValue(self, (x, y), value): self.map[x][y] = value But when I'm trying in python3 it shows invalid sy...
(2) odpowiedzi
2017-10-07 02:10 python - why does multiplication of long and float produce decimal-like answer? »
In this example: long_ten = 10**21 print(' type(long_ten):', type(long_ten)) print(' long_ten: {:52,f}'.format(long_ten)) tenth = 0.1 print(' t...
(2) odpowiedzi
2017-10-07 00:10 How to import a csv-file into a data array? »
I have a line of code in a script that imports data from a text file with lots of spaces between values into an array for use later. textfile = open(...
(2) odpowiedzi
2017-10-05 09:10 Writing python2 codes in python3 »
Can I write python 2 syntaxes in python 3 file and compile with python 3 compiler? What I mean is this: I know that by using future__import one can u...
(1) odpowiedzi
2017-10-04 02:10 membership in Pandas »
fake = {'EmployeeID' : [0,1,2,3,4,5,6] 'ManagerID' : [3,3,5,6,5,4,5] 'Name' : ['A','B','C','D','E','F','G']} df = pd.DataFrame(fake...
(2) odpowiedzi
2017-10-03 06:10 Issue with python version 2.7.3 importing maxrepeat module »
I am trying to import maxrepeat module in python 2.7.3 and couldn’t get much information in google can some one please help. What is the module tha...
(1) odpowiedzi
2017-10-01 22:10 Stop OpenCV for seventeen seconds? python »
I have a motion detection program in OpenCV, and I want it to play a sound when it detects motion. I use winsound. However, OpenCV still seems to be g...
(1) odpowiedzi
2017-09-28 20:09 Simple python code is not working »
The following code is not working: person = input('Enter your name: ') print('Hello', person) Instead of printing Hello <name> it is giving ...
(2) odpowiedzi
2017-09-27 19:09 The TypeError in python »
I'm trying to make a challenge for one of the courses I'm following. I'm new to programming, but I'm eager to learn. Can you tell me in detail why thi...
(3) odpowiedzi
2017-09-27 11:09 Making use of Twitter API to collect users tweet »
I am trying to create an Oauth based twitter application for gathering tweets or texts data of the person who authorize the app and allow me to gather...
(0) odpowiedzi
2017-09-27 07:09 ImportError: No module named naive_bayes »
I just installed sklearn, my program runs no problem when I import it into the code. However, whenever I try to access the naive_bayes module, I get ...
(2) odpowiedzi
2017-09-26 11:09 How do I access the Flask API running on my local system, on another system? »
I am running the flask API using the following statement: app.run(host='0.0.0.0', threaded=True, use_reloader=False) My system IP is: 10.0.0.1, a...
(2) odpowiedzi
2017-09-25 16:09 __add__ two class objects »
I've been learning Python 2 by searching for tutorials. I'm discovering things about class. I have some trouble in __add__ dunder-method. I don't know...
(2) odpowiedzi
2017-09-25 01:09 Design Pattern to merge two implementations into one class »
I can't figure out the correct way to model this problem. Here I give you a minimalistic version of my code: # -*- coding: utf-8 -*- from abc import ...
(3) odpowiedzi
2017-09-25 00:09 TypeError: unhashable type 'list' when trying to download image by link »
Trying to save file by link, but face TypeError: unhashable type: 'list' import requests import lxml page = requests.get('https://karabas.com') for l...
(1) odpowiedzi
2017-09-24 14:09 Speed up multiple downloads with urllib2 »
I'm downloading multiple SMI files from a database called ZINC using a rather simple code I wrote. However, its speed doesn't look like so good consid...
(1) odpowiedzi
2017-09-24 14:09 ViewDoesNotExist at /myapp/ Could not import »
I'm tasked with a migration from 1.8 to 1.11, but I need to ensure I can at least get this site running in 1.8 (it's not my code) before the upgrade. ...
(1) odpowiedzi
2017-09-24 03:09 Does Pillow want my text parameters to be unicode or strings? »
The function in question: PIL.ImageDraw.Draw.text(xy, text, fill=None, font=None, anchor=None) The issue is pretty standard... gibberish: Right ...
(1) odpowiedzi
2017-09-22 22:09 Confusion in using Super in Python »
I am getting an error for the program: class TennisPlayer(): def __init__(self, rank): self.rank = rank def slogan(self): pr...
(1) odpowiedzi
2017-09-22 00:09 How do I create an Or condition on a dictionary of elements in Python? »
dict = {a:[1,2,3,4], b:[4,5,6]} I would like to create a function func1 that takes in a dictionary as an argument def func1(dict, elem1, elem2): ...
(1) odpowiedzi
2017-09-20 08:09 python2 import from module of same name »
With the following directory structure: /util/myclass.py /tests/myclass.py how can I import a class that is defined in util/myclass.py from inside ...
(0) odpowiedzi
2017-09-20 05:09 NameError after using input in Python 2 »
I am learning Python this semester and this is my homework. Can anyone tell me why my code is wrong? QUESTION: You want to know your grade in Comput...
(4) odpowiedzi
2017-09-18 16:09 “iter() returned non-iterator” for dynamically bound `next` method »
Why does this next method I dynamically bound to an instance of a class fail and return a non-iterator object? from collections import Iterator from ...
(1) odpowiedzi
2017-09-18 16:09 Check if line is a dictionary type and print the data? »
I have .txt file and its loaded with a lot of text but in between 2-3 paragraphs there is a text like dictionary: somerandomtextinthisline {"key1":"v...
(2) odpowiedzi
2017-09-18 13:09 How to obtain the total sumation of an list and also its product using Numpy »
Hey guys I am a newbie at Numpy and am trying to learn but having issues. Lets say I have a list and I want to find the total and the product. I can d...
(1) odpowiedzi
2017-09-16 09:09 staircase "#" program in python, correct output but not qualifying default test cases »
Write a program that prints a staircase of size . Input Format: A single integer, n, denoting the size of the staircase. Output Format: Print a stai...
(3) odpowiedzi
2017-09-15 13:09 Unicode confusion #3423435 »
Once again I enter that goddamn unicode-hell ... sigh =( There are two files: $ file * kreise_tmp.geojson: ASCII text pandas_tmp.csv: ...
(2) odpowiedzi
2017-09-15 00:09 Why is this python class instance hashable? »
This is pertaining to python 2.x In the following class, if we subclass "object", I understand the methods are inherited in the derived class Foo whi...
(1) odpowiedzi
2017-09-13 21:09 Unbound local error: ("local variable referenced before assignment") »
import pandas as pd, numpy as np d = [{'Cabin': 'F G13'},{'Cabin': 'A32 A45'},{'Cabin': 'F23 F36'},{'Cabin': 'B24'},{'Cabin': nan}] df = pd.DataFrame...
(2) odpowiedzi
2017-09-13 20:09 Saving and Restoring a model using tensorflow »
I saved parameters of my neural network using this: parameters = { 'w_h1': w_h1, 'b_h1': b_h1, 'w_h2': w_h2, 'b_h2': b_h2, 'w_h3...
(1) odpowiedzi