text stringlengths 226 34.5k |
|---|
Python convert a list of strings in a nested list to list
Question: I have a variable called last_price which outputs:
SPY
Date
2015-02-02 00:00:00+00:00 201.92
I want to extend last_price to a shape of 1000,1 using the following c... |
Install cartopy using pip on mac os and macports
Question: I am trying to install [`cartopy`](http://scitools.org.uk/cartopy/) on OS X
10.10 (Yosemite). My python is installed using macports and when I run:
sudo pip install cartopy
I get the following error:
/usr/bin/clang -Wno-unuse... |
Python: Only saving three latest scores
Question: This is my short quiz made for children. The main body of the program works
fine. But it must save the three latest `correctAnswers` for each user onto a
`.txt` file, deleting the old scores.
I've spent quite some time trying to work out how to use JSON or Pickle for m... |
Edit IPython cell in an external editor
Question: It would be great to have a keyboard short-cut in IPython notebook, which
would allow to edit the content of the current cell in an external editor
(e.g. gvim). Maybe just copy the content of the current cell into a temporary
file, launch gvim on it, and update the curr... |
yum install firefox error - libnssutil3.so
Question: I'm getting this error while installing/listing **firefox** or **python** on a
Linux server. Any ideas how to fix it.
# yum install firefox
There was a problem importing one of the Python modules
required to run yum. The error leading to this p... |
Parallel: Run for loop in Python
Question: I want to make my coed run in Parallel, which is shown as below,
for j in range(nj):
for i in range(ni):
# assign matrix coefficient
This is a very large matrix, which results in very low execution time, how can
I run this kind of code ... |
Translation Using Dictionaries (Python)
Question: Alright so my teacher gave me the assignment below, and we have only been
working with dictionaries for about a day:
1) Create a dictionary to translate a sentence from one language to another
(such as Spanish to English). 2) The program should then write a sentence in... |
Finding the path for a Python module without importing it
Question: How can I find the path for a Python module without importing it?
It seems like it should be obvious but I can't find a function to do this.
(Yes I double-checked the docs for `imp`).
Note: I can't import the module. Also this is a python2 specific i... |
Parsing Google Analytics API Python json response into python dataframe
Question: Trying to parse Google Analytics API Python json response into python
dataframe, and then ETL to MS SQL Server using python.
I get a successful output called feed import json, gdata
data_query = gdata.analytics.client.Data... |
How to bring Tkinter window in front of other windows?
Question: I'm working with some Tkinter Python code (Python 3.4), and I've come across a
problem. When I create my Tkinter window it doesn't show up in front. I do it
currently with the following code:
from tkinter import *
win = Tk()
win.min... |
Python - multiple list by a scalar
Question: Refer to the question mentioned on this link [In Python how will you multiply
individual elements of an array with a floating point or integer
number?](http://stackoverflow.com/questions/8194959/in-python-how-will-you-
multiply-individual-elements-of-an-array-with-a-floating... |
Elasticsearch Percolator with python api
Question: Hi I am trying to do a percolator index using "elasticsearch.py" api. But I am
not even getting any results.
The API documentation seems to have 3 or 4 functions related to percolation.
I have checked the following possibilities. can anyone be of some help , so
that ... |
Python3 Flask upload file in server memory
Question: I'm using Flask in Python3 as a webserver, and am using the upload function of
Flask. Uploading a file to the server results in a
`werkzeug.datastructures.FileStorage` object.
One of the functions I need this file in, also needs to be able to open files
from path ob... |
Persist Read-Only Data Across Jobs via Python Multiprocessing Process Subclass
Question: I am using the [Python multiprocessing
module](https://docs.python.org/2/library/multiprocessing.html) and am looking
for a way to attach read only data once when the process is constructed. I
want this data to persist across multi... |
RethinkDB import error
Question: I'm trying to import CSV or JSON file to Rethink DB but I always get the same
error:
rethinkdb import -f ~/Downloads/convertcsv.json --table test.stats --format json
[ ] 0%
0 rows imported in 1 table
'indexes'
In f... |
Python SocksiPy package error: TypeError: Type str doesn't support the buffer API for string?
Question: When i try and connect to gmail through this code:
import socks
import imaplib
import socket
import socks
s = socks.socksocket()
s.setproxy(socks.PROXY_TYPE_HTTP, '192.168.208.51', ... |
Python: As date strings get passed into dictionary - values jumbled
Question: As I pull the date data from my excel file on my computer which is listed as:
"10/1/10" - and stored in an array `dData`, and the numerical version of the
date is stored in `nData` as: `734046`, so when you call `dData[0]` it returns
`"10/1/1... |
Python-Requests, extract url parameters from a string
Question: I am using this awesome library called [`requests`](http://docs.python-
requests.org/en/latest) to maintain python 2 & 3 compatibility and simplify my
application requests management.
I have a case where I need to parse a url and replace one of it's param... |
Issues with logging on to a website with Python 2.7 requests
Question: I am attempting to automatically log on to the William Hill Website
(<http://sports.williamhill.com/bet/en-gb>) using the requests module for
Python 2.7
import requests
with requests.Session() as c:
url = "https://spo... |
Replace VBA's object "Empty" with pythoncom.Missing doesn't work
Question: Few years ago I wrote script in Python to automate few tedious processes that
I was doing in SolidWorks_2012. I was running that script on Win7 32 bit with
python 27 32 bit and SolidWorks_2012 32 bit.
Now, I faced exactly the same problem and I... |
How to append a string at the end of each line of a string in python?
Question: Let's say, one has stored the stdout of a shell command in a variable. Example
for demonstration:
#!/usr/bin/python
import subprocess
proc = subprocess.Popen(['cat', '--help'], stdout=subprocess.PIPE)
ou... |
Index a Python DataFrame with two Conditions
Question: I'm trying to get a subset of a DataFrame based on two conditions.
Here my simplified example:
import pandas as pd
test = pd.DataFrame(np.ones(48),index = pd.date_range('2015-01-01',periods = 48, freq = '1800S'))
I'd now like to get all va... |
Why doesn't python phonenumbers library work in this case?
Question: It seems like '5187621769' should be a very easy number for the phonenumbers
library to parse. It's 10 digits with a US area code. But...no luck.
**Setup:**
import phonenumbers
number = '5187621769'
**Method 1:**
... |
Use both h5py and pytables in the same Python process
Question: The two main Python libraries for HDF5 interaction are `h5py` and `pytables`.
They don't play nicely together, particularly on windows
>>> import tables
>>> import h5py
ImportError: DLL load failed
>>> import h5py
>>> im... |
Storing the the results of unit test in python in some SQL Database
Question: I am learning the different possibilities to write and run (unit) tests in
Python. I would like to store the output of the tests in a SQL database
-preferably sqlite.
I found a way to run the tests using the nose framework from inside the co... |
Unzip zip files in folders and subfolders with python
Question: I try to unzip 150 zip files. All the zip files as different names, and they
all spread in one big folder that divided to a lot of sub folders and sub sub
folders.i want to extract each archive to separate folder with the same name
as the original zip file... |
Figuring out how to expand a grammar (Python)
Question: Im trying to write code that will return an expanding grammar. so in this
example I will specify a length of 3, N = N D will expand it self to N = N D D
and then it will expand again to N = N D D D but then exit the program, any
advice for making this happen? I cu... |
Django 1.7 ValueError: invalid literal for int() with base 10: 'a'
Question: I am getting this error:
Operations to perform:
Apply all migrations: account, jobs, assets, sessions, admin, auth, laptops, contenttypes, mardes
Running migrations:
Applying assets.0004_auto_20150202_1707...... |
Psycopg2 uses up memory on large select query
Question: I am using psycopg2 to query a Postgresql database and trying to process all
rows from a table with about 380M rows. There are only 3 columns (id1, id2,
count) all of type integer. However, when I run the straightforward select
query below, the Python process star... |
Changing the voice with PYTTSX module in python
Question: When using the Pyttsx module within python, how do you change the voice ID
that is used when playing out text?
The documentation provided illustrates how to cycle through all the available
voices, but does not make clear how to choose a specific one.
Answer: ... |
Iterating through files in a folder in D
Question: In D programming, how can I iterate through all files in a folder? Is there a
D counterpart to [python's
glob.iglob](https://docs.python.org/2/library/glob.html)?
Answer: <http://dlang.org/phobos/std_file.html#dirEntries>
So like
import std.file;
... |
How do I create a Python namespace (argparse.parse_args value)?
Question: To interactively test my python script, I would like to create a `Namespace`
object, similar to what would be returned by `argparse.parse_args()`. The
obvious way,
>>> import argparse
>>> parser = argparse.ArgumentParser()
... |
Python - File does not exist error
Question: I'm trying to do a couple things here with the script below (it is
incomplete). The first thing is to loop through some subdirectories. I was
able to do that successfully. The second thing was to open a specific file (it
is the same name in each subdirectory) and find the mi... |
How to sort integers in a variable?
Question: > Please note that this is on Python 3.3
**Here is the code:**
students=int(input("How many student's score do you want to sort? "))
options=input("What do you want to sort: [Names with scores] , [Scores high to low] , [Scores averages] ? ")
options=... |
Changing the values on the x and y axis of a graph in Python
Question: if I had something like;
import numpy as np, math as m, matplotlib.pyplot as plt
def test():
x = [1,2,3]
y = [m.log(0.1),m.log(0.2),m.log(0.3)]
fig1 = plt.figure()
plt.plot(x,y)
plt.sho... |
Why is my python function being skipped?
Question: I've got a small script that's trying to execute an external command. But for
some reason, the function that I made to execute the command is being
completely skipped over! No errors seem to be raised, it just doesn't execute.
I've got a few debug print statements insi... |
how to adding new tab in readline python
Question: I have a problem can't adding a new tab in reading file.
I've tried readline, but I am confused..
f = open('data.txt', 'r')
count = 0
for i in f.readlines():
count += 1
if count == 3:
#adding new tab
p... |
Attribute error when generating random numbers in Python
Question: I asked a similar question regarding this same piece of code earlier but once
again I have found myself stuck. Particularly on the generation of a license
plate containing two letters, two numbers, and then two letters. I hope that
this question isn't a... |
Python: create sublist without copying
Question: I have a question about how to create a sublist (I hope this is the right term
to use) from a given list without copying.
It seems that slicing can create sublists, but does it with copying. Here is
an example.
In [1]: a = [1,2,3]
In [2]: id(a)
... |
Code for guessing game won't print anything after I enter my number
Question: I am trying to make a guessing game with python but my code won't seem to
work. I am just getting into python so I am not the best. Here is my code.
print "Hello"
print "You have found me, haven't you?"
print "Well, sin... |
Delete words which have 2 consecutive vowels in it
Question: What i want is remove the words which have more than two consecutive vowels in
it. So input:
s = " There was a boat in the rain near the shore, by some mysterious lake"
Output:
[boat,rain,near,mysterious]
So here is ... |
Java syntax equivalent to Python syntax?
Question: So, if you have ever looked on my page you might have found that I'm a Grade
10 student that's just started his computer science course in high school.
Yaay! :)
The language that we are learning is Java, something which in my opinion, is
very different from Python (at... |
python memory exception when not at full memory usage
Question: I am using Ubuntu 64bit 12.04. My machine has 64gigs of RAM. I am running a
script where I have to store ~9gig of data into a dictionary.
It is a simple dictionary where keys are 30 characters and value is just a
integer.
However, the script is throwing ... |
LED control on Raspberry Pi by GPIO with Python
Question: I am using momentary switches wired to GPIO pins on a Raspberry Pi to control
4 LEDs. I have five buttons wired up. The first 4 buttons when pressed toggle
the state of a connected LED from on to off or off to on depending on the
current state. The fifth button ... |
Simple HTML Email: Basic CSS styles being stripped
Question: I am sending a simple email from the command line on a linux machine through a
python script. I have looked up answers about why CSS might get changed,
stripped, etc. in email clients. However, I can't seem to solve what looks to
me like a simple issue.
When... |
django inplaceedit testing project
Question: New to django… Since a month i'm trying to follow
[this](https://github.com/goinnn/django-inplaceedit-
bootstrap/tree/master/testing) tutorial without success. When i syncdb i get
following error:
(virt-inplaceedit)Mac:testing manuelstrasser$ python manage.py ... |
BLAST via Biopython NCBIWWW. Where can I find the complete database list?
Question: I am using the module Biopython module NCBIWWW to blast some sequences online.
I would like to blast my sequences against different databases available,
however I cannot find a comprehensive list of them.
Here is an eample of simple qu... |
Python findall, regex, unicode
Question: I'm trying to write a Python script that searches thru a directory tree and
lists all .flac files and derives Arist, Album and Title from resp.
dir/subdir/filename and write that to a file. The code works fine, until it
hits a unicode character. Here's the code:
i... |
Scraping data through paginated table using python
Question: I am scraping data through google finance's historical page for a stock
([http://www.google.com/finance/historical?q=NSE%3ASIEMENS&ei=PLfUVIDTDuSRiQKhwYGQBQ](http://www.google.com/finance/historical?q=NSE%3ASIEMENS&ei=PLfUVIDTDuSRiQKhwYGQBQ)).
I can scrape t... |
How to set random time interval in scrapy/python?
Question: I am trying to set random time interval and call that function between
iteration in python/scrapy
Note: How to set Random time interval between iteration and function in python
scrapy
import random
class MySpider(CrawlSpider):
... |
Xor tuple function
Question: I'm a beginner in python and I'm blocked on a series of instructions I have to
do. I need to make a function that takes into parameter two tuples of 3
integers. The function will perform a xor between the 2 first integers, then
the 2 second integers, and the 2 third integers. Finally, it wi... |
Alternate Python List Reverse Solution Needed
Question: I had a job interview today. During it I was asked to write down an algorithm
that will reverse a list. First I offered the answer using the reversed()
method:
x = [1,2,3,4,5]
y = reversed(x)
for i in y:
print i
... |
Use urllib.urlretrieve and ignore proxy
Question: I'm trying to use
[urllib.urlretrieve](http://%20https://docs.python.org/2/library/urllib.html#urllib.urlretrieve)
to fetch some files from a server. I need it to ignore any proxy settings on
the system however. I have had a look at
[urllib.urlopen](https://docs.python.... |
python: need a deepcopy equivalent breaking all shared identity
Question: Due to some constrains I need to create a fresh copy of an object alongwith
fresh copies of all its attributes and for attributes of its attributes and so
on recursively.
Existing deepcopy() is recursive, but when multiple objects within the tre... |
Cannot get raw UDP socket to work using Python on a Linux machine with specific IP and Port
Question: I am trying to connect using Python on a Linux system to a Windows system that
is listening at a certain IP and port number using UDP socket.
I know the IP and port number but I do not know any host names. But I thoug... |
Issue with very simple python3 program
Question: Complete noob with python 3. I have some code and can't figure out for the
life of me why I keep getting the output I do. For some reason the elif
statements aren't getting recognized. Here is the output first and the code
down below:
3
Your fortune fo... |
compare two dictionaries in python
Question: How do i campare dictionaries that contain dictionaries ?
This will work in case the dictionaries contain simple values
# will show the keys with different values
d1_keys = set(dict1.keys())
d2_keys = set(dict2.keys())
intersect_keys = d1_key... |
Error using ncdump - NetCDF4 Python
Question: I am using python to read a netcdf dataset. I have installed netcdf and I am
trying to read the data by typing, ncdump("sample.nc",header_only=0). And I
get the below error: /bin/sh: 1: ncdump.exe: not found.
sample.nc is a netcdf file created using the following code:
... |
Insufficient permission Site verification Google
Question: I want to use python and the verification site api (v1) to verify website in
my webmaster tools. In this example I want to get all verified sites using the
verification api, because that function doesn't have parameters. (I know that
it's possible via the webma... |
Python login program
Question: I'm writing a login program in Python,it takes the usernames and the
passwords,and stores it for each user in a separate .txt file. I can already
register,the program creates the file,but i can't login. Here's the code:
###############
import getpass
import time
... |
Scikit-Learn's Pipeline: A sparse matrix was passed, but dense data is required
Question: I'm finding it difficult to understand how to fix a Pipeline I created (read:
largely pasted from a tutorial). It's python 3.4.2:
df = pd.DataFrame
df = DataFrame.from_records(train)
test = [blah1, blah... |
Open URL encoded filenames in Unix
Question: I'm a python n00b. I have downloaded URL encoded file and I want to work with
it on my unix system(Ubuntu 14).
When I try and run some operations on my file, the system says that the file
doesn't exist. How do I change my filename to a unix recognizable format?
Some of the... |
Generating url with fields.Url when using Flask-Restful generates BuildError
Question: I wanted to adapt the wonderful [Tutorial from Miguel
Grinberg](http://blog.miguelgrinberg.com/post/designing-a-restful-api-using-
flask-restful) to create a unittest test-executor. I principally just adapted
the code from Miguel to ... |
Python-ping module not found after installation
Question: I tried to install [python-ping](https://pypi.python.org/pypi/python-
ping/2011.10.17.376a019) with `pip` but I was getting:
Downloading/unpacking python-ping
Could not find a version that satisfies the requirement python-ping (from versions... |
python script for saving subsequent images without overwriting
Question: I am new to python but I have been able to make a script (pls see code below
and attached picture ) that accesses abaqus .odb output file and saves the
contour map as a .tiff file. Since this script runs at interval, the new image
file overwrites ... |
Python: lxml formatting
Question: I need to create an xml file. Is there a possibility to get the following
formatting? The len of the list is normally bigger and always different. So I
can not use if loop with a request of the list length.
Needed formatting:
<test>
<fanart>
<thumb preview... |
Executing python class code located in folders
Question: I currently have a folder structure like this:
.
├── main.py
└── parent.py
└── classes
└── subclass1.py
└── subclass2.py
└── subclass3.py
Each of the `subclass`es are a subclass of `parent`, and parent is a... |
IndexError: too many indices for array while plotting ROC curve with scikit-learn?
Question: I would like to plott the ROC curve that scikit-lern implements so I tried the
following:
from sklearn.metrics import roc_curve, auc
false_positive_rate, recall, thresholds = roc_curve(y_test, prediction[:, 1... |
read and write files from dropbox using python
Question: I am trying to write a code (for my personal use) that will access a
particular directory in my dropbox.
The code currently uses local folder in my machine, and also lives in my local
machine. The minimal code is:
$ cat sync.py
#!/usr/bin/pyt... |
searching files from a lot of files for a keyword and printing the sentence containing keyword,filename in python
Question:
import os
path = 'C:\\Users\\Kabeer\\Documents\\testdata'
listing = os.listdir(path)
for infile in listing:
read_f = open(infile)
for line in read_f:
if 'arc... |
PhantomJS don't load mobile.twitter.com via Selenium
Question: My configuration - _Selenium 2.44.0 + Python 3.4.2 + PhantomJS 2.0.0 (on
Windows 7 x64)_. I try to load <https://mobile.twitter.com> from Python
program using PhantomJS WebDriver and I get error message:
Traceback (most recent call last):
... |
Python Regular expression for splitting mentions of two years appearing altogether
Question: I have the following case, where in my string I have improperly formatted
mentions of the form "(19561958)" that I would like to split into
"(1956-1958)". The regular expression that I tried is:
import re
a =... |
circular numpy array indices
Question: I have a 1-D numpy array `a = [1,2,3,4,5,6]` and a function that gets two
inputs, `starting_index` and `ending_index`, and returns
`a[staring_index:ending_index]`.
Clearly I run into trouble when `ending_index` is smaller than
`starting_index`. In this case, the function should s... |
Uninstalled IPython on Ubuntu but can still be used
Question: I tried to install rpy2 earlier today, to use IPython Notebooks in conjunction
with R. I'm using Ubuntu 12.04. However, I had issues with using the magics
extension, so went off down a rathole to resolve...
I've tried to uninstall IPython via the command
... |
In a Django web application, would large files or many unnecessary import statements slow down my server?
Question: In my Django web app, I have pretty much one large file that contains all my
views. This has a ton of imported python libraries that are only used for
certain views.
Does this slow my code? Like in pytho... |
install issue with python - spacy package in anaconda environment
Question: I'm attempting to follow [this
tutorial](http://honnibal.github.io/spaCy/quickstart.html) to install the
natural language processing package spaCy into a python 3 anaconda
environment, windows 8
I opened console, cd-ed to my site-packages fold... |
How to implement login handover from mechanize to pycurl
Question: I need to login into a website by using mechanize in python and then continue
traversing that website using pycurl. So what I need to know is how to
transfer a logged-in state established via mechanize into pycurl. I assume
it's not just about copying t... |
Python3 correct way to import relative or absolute?
Question: I am writing a python module _neuralnet_. It was working all fine in Python2,
but in Python3, imports are failing.
This is my code structure.
neuralnet/
__init__.py
train.py # A wrapper to train (does not define new th... |
How to get Python List from QVariant
Question: If `Qt.UserRole` the model's `headerData()` returns a Python list variable:
if role==Qt.UserRole:
return QVariant(['one','two','three'])
Instead of a regular Python list a function that calls with:
returnedValue = myModel(index.c... |
Python - retrieved different result when using curl and requests library
Question: I'm trying to build a python crawler using `requests` library. When i use
`get` method i retrieved result look like: `THá» THAO`. But when i use `curl`
i got `THỂ THAO` and it is my expected result. Here is my code:
def ge... |
ImportError: Module not found but sys.path is showing the file resides under the path
Question: When I print sys.path in my code I get the following as output:
['C:\Netra_Step_2015\Tests\SVTestcases',
'C:\Netra_Step_2015\Tests\SVTestcases\TC-Regression',
'C:\Python27\python27.zip', 'C:\Python27\DLLs', 'C:\Python27\lib... |
MongoDB, Python and PyMongo: Document size too large with BSONObj size is invalid
Question: I am getting this error when writing to Mongo:
OperationalFailure caught
10334
{u'connectionId': 2365, u'code': 10334, u'ok': 1.0, u'err': u'BSONObj size: 17254820 (0xA4490701) is invalid. Size must be bet... |
python file writing in threads not writing all lines
Question: I tested my code output and sort it, but I am not having 0-1999 as expected,
lines is missing. Is my code thread unsafe? please suggest how to add thread
lock in my code, and i found that my except all doesn't throw any errors, is
it correct? thanks
... |
OpenERP - Python development environment
Question: I have installed Odoo v8 on VM, with Ubuntu. I am using GEDIT for editing .py
and .xml files. Is there a Python development environment out there where I
can develop, and more importantly, debug my Python code? Thanks in advance for
your help.
Answer: Try installing ... |
Python - Select all elements a list of a list
Question: I want to write a series of code (it may be func, loop or etc.) to get first 6
chars of each list of every list.
It looks like this:
[http://www.mackolik.com/AjaxHandlers/FixtureHandler.aspx?command=getMatches&id=3170&week=1](http://www.mackolik.com/AjaxHandlers/... |
Execute a command on Remote Machine in Python
Question: I am writing a program in python on Ubuntu, to execute a command `ls -l` on
RaspberryPi, connect with Network.
Can anybody guide me on how do I do that?
Answer: Sure, there are several ways to do it!
Let's say you've got a Raspberry Pi on a `raspberry.lan` hos... |
Dll load failed, in python 2.7 running on windows 8.1
Question: I'am using Boneh-Lynn-Shacham Identity Based Signature scheme for my final
year project for getting encryption keys
from charm.toolbox.pairinggroup import *
from charm.engine.util import *
debug = False
class IBSig():
def... |
Best way to get user to input items of different types into a list
Question: What's the best way in Python to prompt a user to input items to an empty list
and ensure the entries are evaluated to correct data types?
For example user enters following mix of `int`, `float`, `str` and `list` item
values:
2... |
Interface use in golang for mocking third party libraries
Question: I'm trying to create a simple mock for unit testing some code using the VMware
vSphere API client - [govmomi](http://godoc.org/github.com/vmware/govmomi) \-
but I'm having trouble finding a usable pattern.
A simple use case for the client library woul... |
Best way to constantly request http data?
Question: Which is the best way to request constant data from a server in Python? I've
tried with Urllib3 but for some reason after a while the python script stops.
And I am also trying urllib2 (see below the code), but I notice there's a huge
delay sometimes (that did not happ... |
make imported modules accessible for further imported modules
Question: There is a main program importing a module with classes or something usefull
that another submodule shall use too. For example:
main.py: ` `import datetime` `datetime.now()` `import mod` `
mod.py: ` `datetime.today()` `
When importing 'mod' modu... |
Multiprocessing pool 'apply_async' only seems to call function once
Question: I've been following the docs to try to understand multiprocessing pools. I
came up with this:
import time
from multiprocessing import Pool
def f(a):
print 'f(' + str(a) + ')'
return True
t ... |
How to pass keyword arguments in reduce over Pandas merge function
Question: I have the following list of data frames:
import pandas as pd
rep1 = pd.DataFrame.from_items([('Probe', ['x', 'y', 'z']), ('Gene', ['foo', 'bar', 'qux']), ('RP1',[1.00,23.22,11.12])], orient='columns')
rep2 = pd.DataFram... |
Can't silence warnings that django-cms produces
Question: I installed Django-cms with the `djangocms-installer` script, and all works
fine except that I get a bunch of `RemovedInDjango18Warning` warnings in the
shell every time I start the server, do anything with manage.py, or even do a
manage.py tab-autocomplete (mos... |
Parsing code used in loop only once
Question: I'm writing a code in Python which can be used to solve equations. The user
must first input a code via a raw_input(), which will then be used to
calculate y for every x in a loop with eval(), like so:
#some imports (math) and other irrelevant code
Code =... |
Python: multiple string test for standard Uk reg, why not working?
Question: The following is a section that has been separated from the main program to
just test the snippet if it works. The "yes" output was for testing each
string method required to see where errors arises. This does not seem to work
and I cant figur... |
Insert only populated entry python tkinter
Question:
for va in entries:
outputmsg = va.get()
es.JournalOut(outputmsg)
selected_ch_name.insert(i,outputmsg)
I have a series of tkinter Entry box's that take user input to select channels
for some data analysis (see below),cur... |
Lambda and multiple statements in Python
Question: Can anyone explaine that behavior of lambda functions?
import sys
X = lambda: sys.stdout.write('first');sys.stdout.write("second")
X()
Returns: -> secondfirst
And one more problem:
lambda: sys.stdout.write("...");sys.exit(0)... |
How to get information from an xlsx file in Python?
Question: I have to create a mailing list of people belonging to a certain institution.
The information is only available in .xlsx file. The columns of xlsx are as
follows: institution, DOB, Program, ..., EmailID. How do I do this, instead of
reading each entry myself... |
Create Bayesian Network and learn parameters with Python3.x
Question: I'm searching for the most appropriate tool for python3.x on Windows to create
a Bayesian Network, learn its parameters from data and perform the inference.
The network structure I want to define myself as follows: ![enter image
description here](ht... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.