How get URLs for 1 million queries?

I have 1 million keywords, and I wanna write program that define category for every keyword via neural network. To learn my program, I need get texts (50-100) for every keyword. To get texts I need get URLs for keywords via search engine -- google, y...
more »

2017-10-04 17:10 (0) Answers

Python3 Function returning only first values

I'm trying to make a function that opens a textfile, counts the words and then returns the top 7 words in percent. However when I run the code with "return" it only retrieves the first value but "print" gives me what I need + a "None". def count_wfr...
more »

2017-10-04 17:10 (0) Answers

How do I cycle through images in Tkinter?

I want to have the button's image cycle through all possible pizza images, but instead it throws the following error when I click on it: self.config(image=next(self.images)) AttributeError: 'buttonInitialize' object has no attribute 'config' Here'...
more »

2017-10-04 04:10 (1) Answers

np.dot output incorrect in Jupyter Notebook

I am getting a different result when I run this code in my terminal vs. a Jupyter Notebook. Both are using Python 3.6 and numpy 1.13.1. Terminal (correct solution): >>> import numpy as np >>> vector_one = np.asarray([ ... [1], .....
more »

2017-10-03 22:10 (0) Answers

From dic pandas with nested dictionaries

I have a dictionary like that: {12: {'Soccer': {'value': 31, 'year': 2013}}, 23: {'Volley': {'value': 24, 'year': 2012},'Yoga': {'value': 3, 'year': 2014}}, 39: {'Baseball': {'value': 2, 'year': 2014},'basket': {'value': 4, 'year': 2012}}} and i ...
more »

2017-10-03 16:10 (2) Answers

Inheritance and Pandas

I am trying to create a file writer based on Pandas' ExcelWriter. I proceeded as I usually do with classes in Python (3) with inheritance: import pandas as pd class Writer(pd.ExcelWriter): def __init__(self, fname, engine='openpyxl'): p...
more »

2017-10-03 15:10 (1) Answers

Mac OS Siera PyQt5 QTabWidget Issue

I usually program on windows (at work) or linux (free time). Now im doing a project for my wife, and she uses a mac. In this project there is a QTabWidget with closeable tabs. On windows the close icon appears properly, and as excepted, however on M...
more »

2017-10-03 07:10 (1) Answers

Variables assignement before function

I have created a package to quickly transform datas using pandas and xlsxwriter. This worked pretty well and I did a few functions successfully. But recently I've hit a wall: For a few functions I need to define variables first but they are not basi...
more »

2017-10-01 11:10 (3) Answers

Passing new shape to `np.reshape`

Within numpy.ndarray.reshape, the shape parameter is an int or tuple of ints, and The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. The documentation signature is j...
more »

2017-10-01 02:10 (2) Answers

Generating random number for class attribute

I have the following code: from numpy import random class Person(): def __init__(self, name, age=random.randint(18,65)): self.name = name self.age = age I want age to be a random number between 18 and 65, unless explicitly sp...
more »

2017-09-28 12:09 (2) Answers