text stringlengths 226 34.5k |
|---|
How to get a list of Ostream or Oinfo in a variable from a repository path in gitpython?
Question: I currently have a valid git database with no packfile, but due to a bug
in`git-pack-objects` _(the process crashes with a stack dump file)_ I’m unable
to perform the`git repack`command.
I took a look at the error, and i... |
Python if statement not working as expected. Code 'apparently' called twice
Question: I have this piece of code:
import bge
import GameLogic
import os
os.system("cls")
scene = GameLogic.getCurrentScene()
objects = scene.objects
objectCube = objects["Cube"]
visible = objec... |
Python indentation error when creating a list
Question: I am getting an indentation error and I cant see why, I defined two lists of
dicts, the first one is fine, but the second one (which follows the same
format) is throwing an indentation error.
list one (no problems):
itemData = [{'id': 11, 'model': ... |
Pythonic way to perform urljoin operation on each value of a column in Pandas dataframe (Python 3.4)
Question: I have Pandas dataframe where one of the columns "url" contains a relative url
path. The values in this column needs to be appended with the base url to be
converted into absolute url.
I am sure looping throu... |
Simple pagination of Django class-based listview failing, template caching to blame?
Question: In a web-based social Django app I have, there's a feature that allows users
to see all unique users who had a session in the past 5 mins. For this, I'm
using [django user_sessions](https://pypi.python.org/pypi/django-user-
s... |
Disable menu item unless exactly one item is selected with PySide
Question: Working with a [`QMenu`](http://doc.qt.io/qt-4.8/qmenu.html) in PySide, I want
to disable a menu item based on a
[`QListWidget`](http://doc.qt.io/qt-4.8/qlistwidget.html) selection count. If
the selection count is exactly one then the 'Edit Ite... |
Postgres says key already exists although it doesn't
Question: My Python application uses Psycopg2 to insert content from a web scraper to a
PostgreSQL database. Psycopg2 complains that a certain primary key already
exists even though it clearly doesn't.
Error:
psycopg2.IntegrityError: duplicate key val... |
Python-tkinter: For loop supposed to collect entries from an array and pass to text box, only passes last entry
Question: I'm new to coding, so apologies if this question is a little base. Anyways,
this GUI im making in python is supposed to collect several user entries, and
pass them to a text box in the GUI. Right no... |
PermissionError when moving image after being opened in Pillow
Question: I have a small script for tallying pagecounts in multi-page TIFFs before
moving them to another drive; but whether or not I explicitly close the images
after opening them with Pillow, I keep getting a PermissionError when
subsequently trying to mo... |
Python BeautifulSoup find_all 'ascii' codec can't decode byte
Question: I'm using BeautifulSoup for extraction of the links to different electoral
subregions outcomes from [Krasnodar krai
elections](http://www.krasnodar.vybory.izbirkom.ru/region/region/krasnodar?action=show&root=1&tvd=2232000821586&vrn=2232000821581&re... |
How do I use file descriptors other than std[in/out/err] in python?
Question: I need to pipe two streams of data to an external program from a Python (3.4)
script. One can go to STDIN, and I'm ok on that:
from subprocess import check_output
data1 = b'This is the data to pass on stdin'
check_... |
Simple Matplotlib animate not working
Question: I am trying to run this code below but it is not working properly. I've
followed the documentation from matplotlib and wonder what is wrong with this
simple code below. I am tryting to animate this into jupyter notebook with
anaconda distro. My python version is 2.7.10.
... |
Python 2.7 mediainfo --inform outputs full info rather than one string
Question: Using the following in powershell produces the expected output of
`01:22:02:03`:
MediaInfo --Language=raw --Full --Inform="Video;%Duration/String4%" filename
My following python 2.7 script always gives the full mediai... |
Error: name "blue" not defined
Question: When the user chooses option 4 on `hall()`, it should run `blue()`, but when I
try to run it I get an error saying that `blue()` is not defined. How do I fix
this?
import time
import sys
name = input ("Name: ")
print ("Hello", (name), ", and ... |
IOError: [Errno 2] No such file or directory on Mac
Question: I've tried to open a file that does exist but I keep getting an error message
of:
No such file or directory on Mac
I have made sure it is in the same directory as the python code. I've also
tried changing the name of the excel doc and wh... |
Perl Command Line Arguments Used In Regular Expressions
Question: Given various strings in a text file that are in this format:
199.72.81.55 - - [01/Jul/1995:00:00:01 -0400] "GET /history/apollo/ HTTP/1.0" 200 6245
I am trying to read in a number from the command line like this:
type... |
How Do you Pass a String Variable to an Exe(Made in Python) in VBS
Question: I am trying to use the following script:
E=inputbox("What do you want me to search?")
Set sh = CreateObject("WScript.Shell")
sh.Run "search.exe "+E, 0, True
and for some reason I cannot discern, it will just quit a... |
Python version conflict. Jhbuild not reading Jhbuildrc?
Question: I was about to set up pygobject for gtk+3. This <http://python-
gtk-3-tutorial.readthedocs.org/en/latest/install.html#id2> page says I need
Jhbuild. I went ahead and installed that. But, it gives me traceback
Traceback (most recent call la... |
Most efficient method of getting possible sum from list in python
Question: Similar to knapsack problem. If I have
list = [5,7,9,12,6]
targetValue = 15
Since 6+9 = 15, what is the most efficient way of getting
[6,9]
Does python have a built in method for such a problem?
A... |
Cython c++ example fails, why?
Question: When I tried to run the example on
<http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html>, I got the
following error on the mac terminal:
Error compiling Cython file:
distutils: language = c++
distutils: sources = Rectangle.cpp
cdef... |
Either the server is overloaded or there was an error in a CGI script
Question: I am beginner in CGI and trying to pass input from HTML to python (html file
input to python file). i dont know where i am doing wrong. I am following
tutorial from
<http://www.tutorialspoint.com/python/python_cgi_programming.htm> and for
e... |
NodeJS 5 errors while installing npm packages
Question: Since I installed node 5.0.0, I start getting errors while installing most of
npm packages. it never happened before when I had node 4.x.
after
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program Files\Python... |
Class name not defined even after stating it
Question: I'm new to python GUI programming and went through this tutorial stating
Tkinter uses
I tried the following code
import Tkinter
class simpleapp_tk(Tkinter.Tk):
def __init__(self,parent):
Tkinter.Tk.__init__(self,par... |
Python- checking for letters, numbers, and underscore character.
Question: I have to write a program that checks if a user's variable name is valid.
These are the rules I am checking for: Only letters, numbers, and the
underscore character are allowed. The first character cannot be a number.
I am not sure what I am do... |
function returns tuple with nothing in it
Question:
#!/usr/bin/python3.5
import os, sys
from time import strftime
from os.path import join
path = '/home/william/.btrfs-snapshots/'
age = 24
todaytuple = (int(strftime("%y")),int(strftime("%m"))int(strftime("%d")))
... |
Python: Functionally Merging Two Iterators Where One is Recursive
Question: The related question [How do I merge two python
iterators?](http://stackoverflow.com/questions/243865/how-do-i-merge-two-
python-iterators) works well for two independent iterators. However, I haven't
been able to find or think of the tools nec... |
Adding Project Path to Python PATH in Sublime Text
Question: I'm collaborating on a Python project using Sublime Text with another person
who uses PyCharms. PyCharms automatically adds the project path to allow easy
import of modules using relative path (relative to the root of the project).
**Question:** In Sublime T... |
Separate list by entries
Question: I have a Python list that I know contains the entries `1`, `2`, and `7`, e.g.,
data = [1, 7, 2, 1, 1, 1, 2, 2, 7, 1, 7, 7, 2]
I would now like to get all of the indices of each entry, i.e.,
g1 = [0, 3, 4, 5, 9]
g2 = [2, 6, 7, 12]
g7 = [1, 8,... |
Python Parse file with Regex
Question: I am hoping someone might be able to get me on the right track here. I need to
parse nmap output with Python. I think using regex is going to be the right
method for this, but I have never worked with regex. Here is a sample of the
text I need to parse --> <http://pastebin.com/QhG... |
Python Numpy - Matrix memory error and limits
Question: after I have been searching this topic on the web, I saw that I was not the
only one to have this problem but I can't understand if there is a way to
overcome the problem or not.
I have 5036 text files and a word list of 15985 words. For each word of the
word lis... |
Setting up a distributed ipython/ipyparallel MPI cluster
Question: I'm struggling to understand how to setup a distributed MPI cluster with
ipython/ipyparallel. I don't have a strong MPI background.
I've followed the following instructions in the ipyparallel docs [(Using
ipcluster in mpiexec/mpirun
mode)](https://ipyp... |
Creating a class-based reusable application
Question: I am trying to create a re-usable application in python 2.6.
I am developing server-side scripts for listening GPS tracking devices. The
script are using sockets.
I have a base class that defines the basic methods for handling the data sent
by device.
... |
Python - Word Count script
Question: Down below is Python word count script that I found online, I am having
difficulty understanding how you would run this though. Would I need to create
a file and open it in Python before running this program for it to work?
#!/usr/bin/env python
import sys
... |
Python socketserver, how to get my own tcp port number
Question: I need to use socketserver to build a tcp server. According to their document,
I need to inherit the class TCPServer, and pass it a subclass of class
BaseRequestHandler where I rewrite the method handle().
Right now I need to build two server on differen... |
Cannot get url using urllib2
Question:
I'm learning Python, and the case for today is download text from a webpage.
This code works fine:
import urllib2
from bs4 import BeautifulSoup
base_url = "http://www.pracuj.pl"
url = urllib2.urlopen(base_url+"/praca/big%20data;kw").read()
soup = ... |
I can't make PypeR run anymore
Question: I can't run the wonderful [PypeR](http://www.webarray.org/softwares/PypeR/) (r
to python interface) anymore. I can import it, but as I try to run it it
crashes.
I suspect it is because I installed El Capitan OSX.
I tried to install update `pypeR` with no success.
when I run i... |
How can I get a startIndex for each match in my RegExp
Question: I'm struggling a bit with a RegExp result. Basically what I want to have, is a
`startIndex` which gives me the exact position for each match related to the
source string. So instead of an array with strings
var regex = /(?:\w*) from "(\w*)"... |
Webscraping with mechanize and beautifulsoup - cannot write output file
Question: I need to get lots of data specific to rivercruising, so I am working with
alteryx, and for scraping I want to use python from the command line. I need
to write the output file to json or to csv. The output file is empty. The
hashtags in ... |
fail to load arff file in python
Question: I am quite sure that my arff files are correct, for that I have downloaded
different files on the web and successfully opened them in Weka.
But I want to use my data in python, then I typed:
import arff
data = arff.load('file_path','rb')
It always ret... |
sorting python list according to given texts
Question: I have the following list:
l = ['fig_1.png', 'fig_10.png', 'fig_4.png', 'fig_2.png']
Expected after sort:
result = ['fig_1.png', 'fig_2.png', 'fig_4.png', 'fig_10.png']
I tried as:
result = sorted(l)
But,
`['fig_1.png', ... |
Can't import namespace package "c4d" but any other name for it works
Question: I've built myself a collection of Python libraries which I collect under the
`nr` namespace. Now for a Python plugin in an application called C4D, I want
to use the `nr.c4d` module, but it can't be imported. Strangely, if I rename
it to anyt... |
Is regex the best approach for this?
Question: Im looking to match an item from a list and place that item into a variable.
Below is what I have put together so far, but currently Im not sure how to
create the regex I need to match just the 1 item and I am not sure if this is
the best approach. I am trying to match the... |
Find amount of times that the chosen letters appear
Question: I have a script where im reading from a file and taking the first two
characters from each word in the line, what i am trying to do is find out
which two letters shows up the most often, do i have to convert my output here
into a list and do it that way ?
h... |
How to cleanup asyncio.sleep() in a coro when te coro finishes before the sleep timeout
Question: I'am not able to cleanup the count_timer (sleep) below, when this counter is
interrupted and finished by another timer event (the stop_future).
import asyncio
import datetime
from concurrent.futures ... |
ImportError: Cython and gcc-5
Question: I want to use some C-functions in Python by using Cython. Here I noticed that
if I use GCC-5 for compiling the C-code (in order to use Cilk) `nm` lists a
lot less entrances in the resulting *.so-function:
0000000000201030 B __bss_start
0000000000201030 b comple... |
why is "any()" running slower than using loops?
Question: I've been working in a project that manage big lists and pass the lists trough
a lot of tests in order to validate or not each word of the list. The funny
thing is that each time that I've used the "faster" tools or generators (like
the `itertools` module) and I... |
Is there a limit on tuple size in python?
Question: I would like to assemble a training set for a neural network. I have a large
csv file with 1017209 rows and 7 columns. I need to extract certain features
from this file, and put them into a tuple. I do it the following way:
import pandas as pd
... |
When calling Python as a subprocess, can I force it to run in interactive mode?
Question: I'm on a mac using Scala, and I want to create a Python interpreter as a
subprocess that my program interacts with. I've been using Process with a
ProcessIO, but python insists on running in non-interactive mode. So it only
does a... |
Implementing Logistic Regression with Scipy: Why does this Scipy optimization return all zeros?
Question: I am trying to implement a one versus many logistic regression as in Andrew
Ng's [machine learning class](https://www.coursera.org/learn/machine-
learning/home/week/5), He uses an octave function called `fmincg` in... |
python PIL save image different size original
Question: I´m working on a project with PIL in python. Simply by opening and saving an
image makes the output image bigger (in Bytes) than the original, maintaining
the same resolution, and i don´t know why...
from PIL import Image
img = Image.open("photo... |
Calling a function from another function for calculation (Python)
Question: My problem is I'm trying to call the function cost from the other function
area to do all the value return from the main function call. This is a
homework and I'm stuck. The problem would be easy for me if I did not have to
call the cost functi... |
Remove elements from nested list - Python
Question:
data = [['A', 'B', 'C', 'D'],
['E', 'F', 'G'],
['I', 'J'],
['A', 'B', 'C', 'E', 'F']]
I would like to remove unpopular elements (appearing only once) from the
lists. So the results should look like this:
da... |
How to integrate code into application in python
Question: This is my application code:
#GUI
from tkinter import *
#Create the window
root = Tk()
#Modify root window
root.title("Simple Bot")
root.geometry("500x400")
#Kick off the event loop
root.mainloop()
This is th... |
np.random.dirichlet with small parameter: embed future solution in current numpy
Question: There is an ongoing discussion about the current `np.random.dirichlet`
function, as it does not function for small parameters:
In [1]: import numpy as np
In [2]: np.random.dirichlet(np.ones(3)*.00001)
... |
Substitution of subprocess.PIPE in Python?
Question: I am using subprocess module to interact with output of the linux commands.
below is my code.
import subprocess
import sys
file_name = 'myfile.txt'
p = subprocess.Popen("grep \"SYSTEM CONTROLLER\" "+ file_name, stdout=subprocess.PIPE, ... |
alligment of objects in wxpython
Question: I added some buttons to BoxSizer. This I what I wanted: [](http://i.stack.imgur.com/HN4T5.png)
This is what I go: [](http://i.stack.imgur.com/... |
Why is my code coming up with the 'expected a character buffer object' python error when i try and write a file?
Question: I have been trying to write my attributes into a file like so:
def player1():
name1=raw_input("what would you like to call the first player?")
diceroll()
... |
Python Matplotlib: plot text will not align left
Question: I am trying to get the values for red dots (for values of 'y2') to plot to the
left of the dots. I'm using ha='left' but to no avail. I tried the following
two aproaches:
for a,b in zip(ind, y2):
plt.text(a, b, str(b), fontsize=14, color=... |
Ipython notebook cannot start up (Windows 8.1)
Question: I'm using a Japanese version of windows 8.1 installed on my computer. The
problem is that my windows is in japanese as such I'm not able to use ipython
to open up .pynb files...Do anyone have similar issues? I will appreciate all
help provided. Thank you.
The er... |
Python Lifetimes Module Error
Question: I was trying to load the Lifetimes Module on my Linux AMI server. I installed
it just fine and everything seemed to work with no error.
However when I went to use it I got the error below. (tried to do a few things
that I thought would fix it but nothing has worked)
... |
How do I find the wss URL for a meteor-deployed app?
Question: I'm trying to connect via DDP to my meteor-deployed website at
<http://testsock.meteor.com> . [This other
answer](http://stackoverflow.com/questions/18857665/how-to-access-app-hosted-
on-meteor-com-by-ddp-websocket-protocol) has been very helpful, but I'm h... |
How to run tensor flow seq2seq demo
Question: I tensor flow installed and successfully went through the MNIST demo. Now, I
am trying to run the [seq2seq
demo](http://www.tensorflow.org/tutorials/seq2seq/index.md#), but this is not
working for me.
I cloned a version of their github repo and attempted to run some of the... |
How to use pyserial expect on a string from serial console, then send a charater
Question: I'm a new to python, hoping someone knows something about the issue I have. I
want to control a device using serial console. A command will be sent to
reboot the device, while the device is rebooting, a string is printed. I want
... |
Search and output with Python
Question: Help guys!!!
List of 150 text files,
One text file with query texts: (
SRR1005851
SRR1299210
SRR1021605
SRR1299782
SRR1299369
SRR1006158
...etc).
I want to search for each of this query... |
How to query entities without no ancestors in appengine python
Question: Consider the following code snippet:
from google.appengine.ext import ndb
import pprint
class Entity(ndb.Model):
name = ndb.StringProperty()
age = ndb.IntegerProperty()
entity = Entity()
e... |
running terminal command from python 3.3
Question: i am trying to run wkhtmltopdf (a routine that convert an html to pdf:
<http://wkhtmltopdf.org>) command from python 3.3 (mac osx 10.7.5).
The routine works like a charm when directly run on terminal with the
following command:
wkhtmltopdf http:google.c... |
AttributeError: 'list' object has no attribute 'extract'?
Question: I just want extract info from this url(<http://www.tuniu.com/g3300/whole-
nj-0/list-l1602-h0-i-j0_0/>) via xpath. As I run the following code ,it occur
AttributeError: 'list' object has no attribute 'extract'? Is my module import
wrong or dont match?
... |
Getting an error while using Pandas.Series.quantile()
Question: As per the documentation on the Pandas page, we are allowed to pass a list of
values to the quantile function in Pandas series.
>>> s = Series([1, 2, 3, 4])
>>> s.quantile(.5)
2.5
>>> s.quantile([.25, .5, .75])
0.25 1.... |
reading HTML(different folders) files
Question: I want to read HTML files in python. Normaly I do it like this (and it works):
import codecs
f = codecs.open("test.html",'r')
print f.read()
The Problem is that my html files are not all in the same Folder since have a
program which generates ... |
execute a python script in C#
Question: I am trying to execute a python code in C#. Normally it should be done using
IronPython and after installing PTVS (I'm using VS 2010).
var pyEngine = Python.CreateEngine();
var pyScope = pyEngine.CreateScope();
try
... |
Can't update my plot with matplotlib
Question: I am receiving data on my client and I have to plot them dynamically using
matplotlib. I want to update my plot continuously. Here is what I tried on a
simple example:
import time
import numpy as np
import matplotlib.pyplot as plt
h, = plt.p... |
Pandas pivot_table using a given list of indices and columns
Question: I would like some help to figure out how to pivot a pandas dataframe into a
table with a given list of indices and columns (instead of the default
behavior where the indices and columns are picked automatically by pandas).
Apologies if this is trivi... |
ValueError: Wrong number of items passed 500, placement implies 1, Python and Pandas
Question: I'm importing just two columns from .xlsx file and I would like to calculate
some stuff (mean, deviation, percent change) and then I would like to plot all
this. First part doesn't give me any problems, but plotting does.
My... |
Representing object values __str__
Question: I have the following code:
import urllib
class Get:
def sendData(self):
self.data = urllib.urlencode({"contains":"silabeador"})
self.u = urllib.urlopen('http://tip.iatext.ulpgc.es/silabas/default.aspx', data)
... |
How to extend Python Enum?
Question: What is best practice for extending `Enum` type in Python 3.4 and is there
even a possibility for do this?
For example:
from enum import Enum
class EventStatus(Enum):
success = 0
failure = 1
class BookingStatus(EventStatus):
dup... |
Python Multiprocessing - Too Slow
Question: I have built a multiprocessing password cracker (using a wordlist) for a
specific function, it halved the time needed compared to using a single
process.
The original problem being that it would show you the cracked password and
terminate the worker, but the remaining worker... |
Having a function set a global variable
Question: Consider the following C++ module (explanation to follow):
#include <Python.h>
#include "nr3python.h"
Doub tau_0;
static PyObject* analysis_c_set_parameters(PyObject *self, PyObject *pyargs) {
NRpyArgs args(pyargs);
Doub ... |
Bokeh DataTable won't update after trigger('change') without clicking on header
Question: Bokeh version: 0.10 Python: 3.4 Jupiter: 4.x
Goal: create a table that only shows data selected from a scatter plot
Problem: the DataTable only refreshes itself after being clicked on despite
the: s2.trigger('change'). In other ... |
AWS Lambda Python with MySQL
Question: I'm trying to connect to mysql from my AWS Lambda script.
I did
`pip install --allow-external mysql-connector-python mysql-connector-python -t
<dir>`
to install mysql-connector-python in local directory.
I zipped the file and uploaded it to AWS Lambda where my python files... |
Python Sockets: Connection Timeout
Question: I'm trying to write two short python scripts that will connect two or more
machines to each other, one as the server and the others as clients. It worked
perfectly when testing the client and the server script on the same computer,
but when I tried it from another computer t... |
Generating random X,Y coordinates in a grid
Question: I'm fairly new to Python and this site. I'm hoping someone can help me with
this and clarify a few things. I'm stuck at this part in my battleship
program. I have a 10x10 grid and I want to randomize the locations for each of
the 3 ships within my grid . I also want... |
Translate pandas column with TextBlob
Question: I'm trying to read a csv and translate one column that is written in French to
English with the TextBlob package in Python (2.7.10 Mac OS X Yosemite).
However, Python throws the following error message at me:
AttributeError: 'Series' object has no attribut... |
Calculate mean on values in python collections.Counter
Question: I'm profiling some numeric time measurements that cluster extremely closely. I
would like to obtain mean, standard deviation, etc. Some inputs are large, so
I thought I could avoid creating lists of millions of numbers and instead use
Python collections.C... |
Python application trying to insert into oracle
Question: I have a simple tkinter application I built to put in the amount of hours I
worked. for some reason I keep getting this error "DatabaseError: ORA-01036:
illegal variable name/number" any help will be greatly appreciated!
here is my SnowTime.py
im... |
Hadoop ERROR streaming
Question: I have a Mapper:
join1_mapper.py
#!/usr/bin/env python
import sys
for line in sys.stdin:
line = line.strip()
key_value = line.split(",")
key_in = key_value[0].split(" ")
value_in = key_value[1]
... |
python if statement always false
Question: I am having issues with an if statement always returning false. I am writing
my code in Canopy. I am almost positive it's my syntax, because I replaced "is
'graj mahal'" with "> 200", input a value of 300 and it returned "sounds
great!". Here is the excerpt of my code in quest... |
Use attribute and target matrices for TensorFlow Linear Regression Python
Question: I'm trying to follow [this
tutorial](http://www.tensorflow.org/tutorials/mnist/beginners/index.md).
TensorFlow just came out and I'm really trying to understand it. I'm familiar
with _penalized linear regression_ like Lasso, Ridge, and... |
pairwise comparison within a column pandas python Biopython
Question: i have a large data set that i read in with pandas and i want to do pairwise
alignment by pairwise2.
import pandas as pd
from pandas import DataFrame
from Bio import pairwise2 #for pairwise alignments
from Bio.pairwise2 ... |
Dynamic Python Unit Test
Question: I am new to python unit testing. I have been playing with unittest and
py.test. I want to validate data in that is ini format. An example
[Section1]
key1 = value1
key2 = value2
key3 = value3
...
[Section2]
key1 = value1
...
The section ... |
Using AWS ECS with Boto3
Question: I would like to lunch a Task on ECS cluster and wait for the task termination.
import boto3
client = boto3.client('ecs')
response = client.run_task(
cluster='default',
taskDefinition='RGB',
overrides={
'containerOverride... |
python, heapq: difference between heappushpop() and heapreplace()
Question: I couldn't figure out the difference (other than ordinality of push/pop
actions) between functions heapq.heappushpop() and heapq.heapreplace() when i
tested out the following code.
>>> from heapq import *
>>> a=[2,7,4,0,8,12,... |
Python Impyla fails after Kerberos install
Question: I'm on a W7 machine, where I use Python (Anaconda distribution) to connect to
Impala in our Hadoop cluster using the Impyla package. My company has recently
added Kerberos and that ended up breaking what I had in place.
**before Kerberos:**
from impal... |
import gensim imports a file in an active module, not the root site-packages folder
Question: I'm running Anaconda Python 2.7 on Windows. I've installed gensim and pyLDAvis
to do some topic modeling. (Note installing pyLDAvis on python 2.7 in windows
is a little tricky as you have to make sure you are not using scikit-... |
jQuery ajax code loading scripts as text, but some of the code is being processed
Question: I am working on a block of code and it is doing something funny. I wrote this
for a site that I am working on to load a url from an XML file and insert the
code from a server side file into the pre tag as a way of showing the co... |
Celery (Django) ImportError: No module named billiard.exceptions
Question: I'm using current versions (Celery 3.1.19, Billiard 3.3.0.21) and unable to
successfully deploy my Django site to AWS Elastic Beanstalk.
I'm trying to figure out if this is a WSGI issue, a system path issue, an app
issue, etc. I had the site wo... |
Adding progress feedback in Grequests task
Question: I've followed the grequests [usage
example](https://github.com/kennethreitz/grequests), but I'm trying to add
some progress feedback. A percentage of the completed requests. How could I
achieve that?
import grequests
urls = [
'http://w... |
Remove special characters from indvisual python list
Question: I have a list that contain many elements. I was able to find a way to remove
duplicates, blank values, and white space.
The only thing left is to:
1. remove any thing that contain (ae) string.
2. remove from the list any thing that contain the period ... |
Python prints unwanted extra newline
Question: Why is that Python always prints an extra newline when I run the code below? I
tried to re-write the code to eliminate any unintended blank space but it
still prints out an extra new line. Anyone knows why? Thanks.
def main():
names_in() ... |
Font not printing out in pygame program
Question: I'm writing a program in Python that will act as a scratch ticket type of
game. I have everything done except printing out the numbers when the user
'scratches off' the square on the ticket. This is my code:
import pygame
pygame.init()
... |
How to automatically parse csv in python 2.7 into int, string and list objects and their values
Question: I want to be able to parse csv files that will be maintained outside of our
software group. A sample csv may contain:
temperature,50,55,56
color,blue
count,10
dummy,line
The code wi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.