Interesting Tags
   11 tags on

1 answer

How to use a weighted mean estimator in seaborn factor plot (incl bootstrapping)?

I have a dataframe where each of the rows has a certain weight which needs to be accounted for in the mean computations. I love seaborn factorplots and their bootstrapped 95% confidence intervals but ...

1 answers | 6 mins ago by Tim on Stack Overflow
0 answers

Using Pyhon loops with Jinja template

I have some simple Python, the goal of which is to deploy a hosts file. The hosts file is intended to look like this: [master1] *hostname* [master2] *hostname I'm using Python to try and achieve ...

0 answers

How do widen the column width in this code so that the columns are the size I want in excel

Code: import xlwt file = 'C://Users/MM/Desktop/' wb = xlwt.Workbook() sh = wb.add_sheet('S1') d = ...

1 answer

parse a file for a line with specific text, then logic to determine next steps

I am trying to scan a textfile for a specific keyword. When this keyword is found there's a numeric value on the line that I need to compare to see if it's less than a set value. If it is, the ...

1 answers | 7 mins ago by boogiewonder on Stack Overflow
0 answers

Python, Selenium and Scrapy not working together?

I want to crawl the flight tickets from British Airways and store it in Mongo. I am able to go past the search form but i can't scrape the given data. My Spider: from scrapy import Spider from ...

2 answers

How can I navigate a site after logging in

I have used mechanize and successfully logged into a user login page. Now I want to navigate the site to a specific page in the submenus. When I try this by opening the URL of the specific page after ...

1 answer

Cannot upgrade Pip. Permission denied. Why?

I'm trying to upgrade pip on my iMac, but I keep getting a permission denied error. I'm the admin, so I don't know what I've done wrong. iMac:~ me$ pip install --upgrade pip You are using pip ...

1 answers | 10 mins ago by Chef1075 on Stack Overflow
1 answer

Make a list of 50 random numbers in the range 1-50, such that adjacent numbers are not within 15 of each other

This is what I have so far but it breaks if I go past plus or minus 11 the previous number. So if the previous number is 1 the next number has to be more than 16. Also I am trying to only use each ...

1 answers | 10 mins ago by Dan Salazar on Stack Overflow
4 answers

printing a python code multiple times (NO LOOPS0

I've been having trouble getting a specific print in Python 3.4 Input: str=input("Input Here!!!:") num = len(str) x = num print (((str))*x) but I'm looking for an output that prints str x times, ...

4 answers | 11 mins ago by jubjub on Stack Overflow
0 answers

How do I go from a time series to audio using Python?

I have this long time series sampled at 32 MHz. I could either downsample it to 44100 Hz or just "pretend" it's 44100 Hz or so. Either way, I have this time series in NumPy array format. Now, I want ...

0 answers

Having issue getting proper Checkbutton state in Python

As a complete noob in Python I stared to play around last few days with the syntax to try and create some kind of a program that came to mind. My initial idea was to make a place to create your own ...

0 answers

Windows won't open .py files, even when “python launcher for windows (console)” is assigned

Phyton was working fine, until one day IDLE refused to open (nothing happened when I double clicked it), so I decided to reinstall it. After I was done (I installed Python 3.5), IDLE was working ...

1 answer

Process dies, if it is run via paramiko ssh session and with “&” in the end

I just want to run tcpdump in background using paramiko. Here is the part of the code: ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(host, ...

2 answers

Freezing all but one positional arguments

What's a good way to define a function partial_k(f, k, args) that takes an arbitrary function f as input (f takes n positional arguments), a value k, and a list of n-1 values, and returns a new ...

0 answers

Is there a way to see what stream a given CL was submitted to

I have a python script that grabs perforce CL information and whacks it into an xml file, but I can't seem to find a way to see what stream the changelist was submitted into. I am not sure if it is ...

1 answer

Parsin JSON in python

I am pulling a json response from an api. I then want to turn that response into a dictionary. import requests import json import time count=1 testdata = open('testdata.txt', 'a') for data in ...

1 answers | 17 mins ago by M Arroyo on Stack Overflow
1 answer

How to plugin python interpreter in a website?

I am trying to make a website for learning to code. So i want to hook up a python interpreter to a website and also do verification of the users code. How do I do that?

1 answers | 19 mins ago by roshanthejoker on Stack Overflow
0 answers

Packed Bit Fields in Python

I want to pack a 10-bit integer and a 54-bit integer into a 64-bit structure. But this code ends up using 128 bits. from ctypes import * class ABC(Structure): _fields_ = [("a", c_int, 10), ("b", ...

0 answers

Custom comparisons with Django (hamming distance)

I have the following code that allows me to find images of equal has (identical), but say I wanted to just find images with a hamming distance under a certain number, can that be incorporated into ...

4 answers

How to clear Tkinter Canvas?

When I draw a shape using: canvas.create_rectangle(10, 10, 50, 50, color="green") Does Tkinter keep track of the fact that it was created? In a simple game I'm making, my code has one Frame ...

2 answers

read_csv in pandas - how to use a specific row as header

tring to parse this file : that looks like : metadata line metadata line metadata line metadata line metadata line metadata line metadata line metadata ...

2 answers | 29 mins ago by user1013346 on Stack Overflow
1 answer

Changing point color depending on value in real-time plotting with Bokeh

I am using Bokeh in an experiment to plot data in realtime and the library provides a convenient way to do that. Here a snippet of my code to accomplish this tasks: # do the imports import pandas ...

0 answers

Implementing Local Binary Patterns (OpenCV C++)

I am currently following a tutorial on local binary patterns, however the tutorial is in Python and I have to use C++ (with OpenCV). The tutorial is about Texture Matching using Local Binary ...

2 answers

Wrapping np.arrays __pow__ method

I was just revisiting some of my code to improve the performance and stumpled over something strange: a = np.linspace(10,1000,1000000).reshape(1000,1000) %timeit np.square(a) 100 loops, best of 3: ...

2 answers | 31 mins ago by MSeifert on Stack Overflow
2 answers

How to return the row and column from a table in python?

my question is how do I create another function 'find_letter' that will return the row and column of a specific letter, I tried using "if(letter in table):" but it uses the original table. And if I ...

2 answers | 34 mins ago by Jessy White on Stack Overflow
0 answers

Python: Moving letters within the alphabet in a string

I've been working in Python and have been trying to move all letters in a string n spaces in the alphabet, however I've run into a fair amount of errors. print("Cryptography") userInput = ...

0 answers

Is there a way to send post data using esky?

Is it possible to send post data in esky? #I need to be able to send post data in this request app = esky.Esky(sys.executable,"")

3 answers

python word counter display duplicates only

can some one help me im trying to do counter in python but i dont want results if they are not duplicated from collections import Counter import collections with open('test.txt') as myFile: ...

3 answers | 35 mins ago by Night5talker on Stack Overflow
0 answers

Issue to play a mp3 file with a Python script from Arduino data

I am trying to perform the following action with an Arduino Uno and a Python script: if the length calculated by the ultrawave sensor of Arduino is below 36 then play a music which is on my hard ...

5 answers

Python- Reading whole txt file as 1 line


5 answers | 40 mins ago by Donka on Stack Overflow
15 30 50 per page
1 2 3