python-2.7 Questions

4

Solved

QIIME requests this (here) regarding the fasta files it receives as input: The file is a FASTA file, with sequences in the single line format. That is, sequences are not broken up into multiple li...
Cheryllches asked 11/6, 2014 at 7:1

9

Solved

Question in Short: How can I use the find and replace option (Ctrl+H) using the Python-pptx module? Example Code: from pptx import Presentation nameOfFile = "NewPowerPoint.pptx" #Replace this wi...
Dehumidify asked 20/6, 2016 at 14:15

2

Solved

I have a form wherein I'm trying to insert a static image file in between an if-else loop in HTML. Here's the source code of the template: <!DOCTYPE html> <html> <head> &...
Toothpaste asked 29/6, 2015 at 14:9

3

Solved

If I do a groupby() followed by a rolling() calculation with a multi-level index, one of the levels in the index is repeated - most odd. I am using Pandas 0.18.1 import pandas as pd df = pd.DataFr...
Morrison asked 8/2, 2017 at 17:28

2

If I have a writable buffer, I can use ctypes.c_void_p.from_buffer function to obtain a C pointer to this buffer. How to deal with non-writable buffers, however? How to form a const pointer that I...
Arabist asked 12/12, 2012 at 17:47

3

Solved

I want to convert unicode string to its hexadecimal representation. For example, u'\u041a\u0418\u0421\u0410' should be converted to "\xD0\x9A\xD0\x98\xD0\xA1\xD0\x90". I tried the code below (pyth...
Godlike asked 2/1, 2017 at 1:53

3

Solved

So I know of opencv and pymovie however I cant seem to find a working example on here or anywhere on google or this site. I do not want to convert the mp4 into anything else. It has to be mp4 file ...
Leff asked 14/4, 2016 at 22:2

6

Solved

I am trying to find patterns in a numpy array, called values. I'd like to return the starting index position of the pattern. I know I could iterative over each element and check whether that elemen...
Feudality asked 27/2, 2017 at 17:23

8

I'm trying to use a python script to download files from a Chinese service provider (I'm not from China myself). The provider is giving me a .zip file which contains a file which seems to have Chin...
Yautia asked 7/12, 2016 at 14:11

4

Solved

What is the recommended/most pythonic way of editing a tuple in code like that shown below? tup_list = [(1, 2), (5, 0), (3, 3), (5, 4)] max_tup = max(tup_list) my_tup1 = (max_tup[0] + 1, max_tup[1...
Defilade asked 20/7, 2016 at 12:55

7

Solved

I'm trying to write something that checks if a string is a number or a negative. If it's a number (positive or negative) it will passed through int(). Unfortunately isdigit() won't recognize it as ...
Regression asked 26/5, 2016 at 22:59

4

Trying to open xlsm file using python Below is the code : import libraries import openpyxl from openpyxl import load_workbook from openpyxl import Workbook from openpyxl.styles import colors from...
Frankish asked 9/1, 2019 at 9:16

3

Context : This is the problem https://github.com/pypa/pip/issues/6717#issue-468204416 I'm facing and trying to solve via https://github.com/pypa/pip/issues/6717#issuecomment-511652167 I want to us...
Racy asked 11/9, 2019 at 16:13

5

Solved

I've been trying to use "copytree(src,dst)", however I couldn't since the destination folder should exists at all.Here you can see the small piece of code I wrote: def copy_dir(src,dest): import ...
Pulpiteer asked 6/4, 2012 at 18:20

2

Solved

The following function returns None: In [5]: def f(): ...: pass So I was not surprised by this output: In [8]: dis.dis(f) 2 0 LOAD_CONST 0 (None) 3 RETURN_VALUE In [10]: f.__code__.co_cons...
Paryavi asked 27/12, 2014 at 13:33

3

Solved

I am attempting to fill out a word document form with Python 2.7's docx module. I can modify text elements just fine but I am having difficulty figuring out how to check a yes or no checkbox. How ...
Burrows asked 25/4, 2017 at 19:59

3

Solved

There is an existing thread about this Zipping unequal lists in python in to a list which does not drop any element from longer list being zipped But it's not quite I'm after. Instead of returning ...
Buddhi asked 25/4, 2019 at 10:9

2

the issue: running Python's matplotib from a Windows virtual environment as reported & discussed Github ticket 93 and a relevant suggested fix here. Code (myp.py): import matplotlib.pyplot a...
Ashmore asked 19/2, 2016 at 19:30

2

I Am trying to send a signal from a child thread to the main thread in a multi-threaded program (cannot use multi-processes). Unfortunately even after exhausting all the reading materials available...

3

Solved

When passing x,y in fit, I am getting the following error: Traceback (most recent call last): File "C:/Classify/classifier.py", line 95, in train_avg, test_avg, cms = train_model(X, y, "cep...
Calycine asked 24/11, 2016 at 7:12

5

Solved

1) I need to set one of my three ttk.Radiobuttons activated by default when I start my gui app. How do I do it? 2) I also need to check if one of my ttk.Radiobuttons was activated/clicked by th...
Irrupt asked 9/9, 2013 at 22:39

6

Solved

How do I print out my dictionary in the original order I had set up? If I have a dictionary like this: smallestCars = {'Civic96': 12.5, 'Camry98':13.2, 'Sentra98': 13.8} and I do this: for car...
Tasker asked 21/11, 2013 at 1:19

9

I have installed anaconda4 on my ubuntu and I have these modules on my Python: dbus-python (1.2.4) gi (1.2) pydbus (0.2) QtAwesome (0.3.2) qtconsole (4.2.0) QtPy (1.0) sip (4.18) I tried ins...
Hiers asked 30/5, 2016 at 8:38

7

Solved

I have a bunch of servers with multiple instances accessing a resource that has a hard limit on requests per second. I need a mechanism to lock the access on this resource for all servers and inst...
Roadside asked 12/4, 2014 at 22:39

9

AttributeError: module 'umap' has no attribute 'UMAP' I tried installing & reinstalling different libraries of umap and umap learn but didn't work any..
Embay asked 28/7, 2019 at 15:15

© 2022 - 2024 — McMap. All rights reserved.