Sample Filter
   11 tags on

1 answer

Get a specific string from a list - Python

I have a list that looks like this: list = ['Julio Cesar por inhumana (?)', '1/4/2015', '1/4/2015', '1/4/2015'] and i just want the dates. I have a regex that looks like this : ...

1 answers | 5 secs ago by user3799942 on Stack Overflow
0 answers

How to assign values elementwise to theano matrix ? Difference between Numpy and Theano?

I'm new to theano. I would like to replace the numpy functions in my scripts with theano functions in order to speed up the calculation process. I'm not sure how to do it. My final goal is to apply ...

1 answer

low RAM consuming c++ eigen solver

I'm newbie in C++ programming, but I have a task to compute eigenvalues and eigenvectors (standard eigenproblem Ax=lx for symmetric matrixes (and hermitian)) for very large matrix of size: ...

1 answer

Python Cursor to Csv using csv.writer.writerows

I'm currently trying to write the results of a MySQL select statement to a csv. I'm using MySQLdb to select data, which returns a cursor. I'm then passing that cursor into a function that writes it ...

1 answer

Delete Rows from Pandas DataFrame with matching column but not index

Basically I have a list of inventory from devices, what I need to do is find out which is mirrored and which isn't. It is indexed by device at the moment. Device ...

1 answers | 3 mins ago by user3866172 on Stack Overflow
5 answers

Python: Is there a one line script to title case strings except for strings that start with a digit?

The title() method works great, but I have a situation where there are strings that start with both words and numbers and I only want to titlecase the words in the string that do not begin with a ...

5 answers | 3 mins ago by Startec on Stack Overflow
1 answer

Why is my code for Project Euler #12 so slow?

def trisum(): divs = 1 great = 1 n = 1 while divs < 500: divs = 1 n += 1 tri = sum(i for i in range(1,n+1)) #divisors = [tri] for x in ...

0 answers

Clean URLs with Flask

I have two views like so: @app.route('/send') def send(): string = 'Hello World' return render_template('send.html', string=string) @app.route('/receive/<string>', methods=['GET']) def ...

0 answers

How does one calculate the smoothing condition used in python's interpolate.splrep?

I'm attempting to fit a cubic spline to a time-series using scipy's interpolate.splrep. However, I can't work out how to determine a valid smoothing condition without manually adjusting it by eye. It ...

4 answers

What is Python's Fabric equivalent in other languages?

Can someone tell me what's the equivalent of Python's Fabric in Python itself, other languages or third party tools? I am still a bit fuzzy on what it is trying to accomplish and it's usage.

4 answers | 7 mins ago by Thierry Lam on Stack Overflow
1 answer

Python Method and Classes in GUI Error

I am attempting to create a GUI using Python classes. Because I'm new to Python, I'm still learning to troubleshoot my errors. Below, I wish to create a class called Plot_Seismo, and create a GUI ...

1 answers | 7 mins ago by user78872 on Stack Overflow
1 answer

Use Python to scape html with anti-scrape protection

I am new to web scraping so bear with me please. Trying to scrape a site with Python. Specifically, the information within section <h2>Parties</h2>. The site needs log in and the ...

1 answers | 7 mins ago by Wombat on Stack Overflow
1 answer

How to encode Python 3 string using \u escape code?

In Python 3, suppose I have In[1] thai_string = 'สีเ' Using encode gives In[2]: thai_string.encode('utf-8') Out[2]: b'\xe0\xb8\xaa\xe0\xb8\xb5' My question: how can I get encode() to return a ...

5 answers

What is the correct way to document a **kwargs parameter?

I'm using sphinx and the autodoc plugin to generate API documentation for my Python modules. Whilst I can see how to nicely document specific parameters, I cannot find an example of how to document a ...

1 answer

Difference between linear regression in Python (and R) and Stata

I'm porting a Stata model to Python, and seeing different results for Python and Stata for linear regression using the same input data (available @ ...

1 answer

Does opencv have Savitzky Golay or Polynomial fit?

I can't find anything similar to Savitzky Golay Polynomial Fit on opencv. This is a standard smoothing operation though, so it seems like something they should have. Does anybody know of anything they ...

0 answers

Q: Pandas dataframe.to_csv() writing only final line

Pretty new at Python and Pandas here. trying to write a script that will read a predetermined list, remove unnecessary strings, use each line in the list in a MySQL query, then write the results to a ...

1 answer

How can I pull a fork, merge changes from upstream and then push back to fork?

I realize that this is a fairly documented process, but I seem to continue hitting a hiccup. I want to pull a forked project (jenkinsci/pluginname), and then merge changes from upstream ...

1 answers | 15 mins ago by John Zeller on Stack Overflow
0 answers

ID Contrant Failed on Edit for bulk loaded django data in many to many field in postgres

I have an issue with bulk imported data into Django Manytomany fields. I had to load a very large dataset into my postgres django app that had a ManyToMany on one of its models. Something like this: ...

2 answers

Using div with unsigned integers

The C++ standard provides div(int, int), but not udiv(unsigned int, unsigned int). If I naively used unsigned ints in this function, I can see that this would yield the wrong result for integers ...

2 answers | 15 mins ago by castle-bravo on Stack Overflow
1 answer

printing format in python - expected left allignment

I have a function that basically takes in a dictionary with a list of values for each key and it processes the dictionary to get the total count of values for each key and then it sorts them based on ...

1 answer

How to filter a DataFrame column of lists for those that contain a certain item

If I want to filter a column of strings for those that contain a certain term I can do so like this: df = pd.DataFrame({'col':['ab','ac','abc']}) df[df['col'].str.contains('b')] returns: col 0 ...

1 answers | 17 mins ago by rurp on Stack Overflow
0 answers

EC+B - How to Sorted Listbox Items Numerically

So I need tour help...! I am using a ListBox control that displays multiple ping items of Indy 10.6.2 Rev 5300's TIdIcmpClient in EC+B XE8. The issues that I wanna accomplish is to ensure that all ...

6 answers

Activate a virtualenv with a python script

I want to activate a virtualenv instance from a python script. I know it's quite easy to do, but all the examples I've seen use it to run commands within the env and then close the subprocess. What ...

6 answers | 19 mins ago by h3. on Stack Overflow
5 answers

How to Convert Each Character in a String using Python

I have a sequence of characters that I want to convert them into specified charter. Seq = "AA" #This the sequence of characters def complement (Seq): for nuc in Seq: # converting the sequence of ...

5 answers | 22 mins ago by Bahrani on Stack Overflow
3 answers

Objects are not considered the same in Dictionary keys - but __eq__ is implemented

The following code gives an error message: class Test(object): def __init__(self, test = 0): self.test = test if __name__ == '__main__': t1 = Test(1) t2 = Test(2) t3 = ...

0 answers

Pymongo Concurrency and the Multiprocessing Module

I'm trying to understand the best way to parallelize the processing of queries or query results using pymongo. All of my reading says that you should have a small number of MongoClient() objects. Say ...

0 answers

Incorrect output from git rev-parse --is-inside-work-tree

After updating to the latest Windows Git (2.5.0 from 1.6.2) I find I'm unable to rebase a branch: C:\core\guidewire\Dev\2.4>git checkout fhcf-assumptiondate && git rebase master Previous ...

0 answers

What do they mean by “Add these integers to sum”?

Write a simple C++ program called sum.ccp, the program should: 1. Read a file that contains several integers. 2. Print these integers on screen. 3. Add these integers together to sum. 4. Print the sum ...

1 answer

'SignUpForm' object has no attribute 'get'

I try to develop a django project with the sign up form. After user entering their information and submit the form, an user uuid is assigned to this user. The error is: 'SignUpForm' object has no ...

1 answers | 28 mins ago by Renee on Stack Overflow
15 30 50 per page
1 2 3