Python for .NET installation: Could not load file or assembly 'clr.pyd'

Python
Really sorry guys! But for the life of me I am nearing the breaking point of going mad trying to install Python for .NET. I read the instructions meti...
3 years ago

Reading JSON file in Python and detecting specific keywords in field

Python
I just started this week to learn Python and I have the following question. I have a JSON file (Aberdeen2015.json) that contains 60 lines (each line c...
3 years ago

What does the yield keyword do in Python?

Python
What is the use of the yield keyword in Python? What does it do? For example, I'm trying to understand this code1: def node._get_child_candidates(se...
3 years ago

Working with Password Protected Excel Sheets in Python on Linux

Python
The problem is pretty simple. Every week I receive a bunch of password protected excel files. I have to parse through them and write certain parts to ...
3 years ago

How to join strings together within a list?

Python
my task is the following Write a menu for an online food service with the option of 4 different cuisines ie: Mexican Each of the cuisines should ha...
3 years ago

How can I make setuptools install a package that's not on PyPI?

Python
I've just started working with setuptools and virtualenv. My package requires the latest python-gearman that is only available from GitHub. The python...
3 years ago

Python, Determine if a string should be converted into Int or Float

Python
I want to convert a string to the tightest possible datatype: int or float. I have two strings: value1="0.80" #this needs to be a float value2="...
3 years ago

Finding most sequences of specified length

Python
I'm trying to write python code that will take a string and a length, and search through the string to tell me which substring of that particular leng...
3 years ago

How to recreate a sentence from the list of unique words and the position

Python
I am creating a program which recreates a sentence from it's unique words and the positions of them. So far I have managed to collect the unique wor...
3 years ago

Generate Python Class and SQLAlchemy code from XSD to store XML on Postgres

Python
I have some very complex XSD schemas to work with. By complex I mean that each of these XSD would correspont to about 20 classes / tables in a databas...
3 years ago

Python - Join Multiple Threads With Timeout

Python
I have multiple Process threads running and I'd like to join all of them together with a timeout parameter. I understand that if no timeout were neces...
3 years ago

Python nested loop to identify characters in string of text

Python
I have a string of text that reads: 1x2xx1x2xx1x2xx1x2xxx I need to take apart the string of text, and if it is a number, i want to pass that numbe...
3 years ago

How to merge DataFrames with slightly different merge fields

Python
I'm trying to merge a set of DataFrames around a common timestamp for various assets. The data sets conatain hourly data, however the timestamp is sli...
3 years ago

How to pass a variablename to unix command in subprocess in python3

Python
I am trying to use unix diff command in subprocess , when I hardcode, it works fine, But I added it in a function where I need to pass these arguments...
3 years ago

Django Shell No module named settings

Python
I've deploy Django to Apache via mod_wsgi. Django is running fine when hosted from Apache. However, I'm trying to do some maintenance via manage.py, b...
3 years ago

How to print substring using RegEx in Python?

Python
This is two texts: 1) 'provider:sipoutilp1.ym.ms' 2) 'provider:sipoutqtm.ym.ms' I would like to print ilp when reaches to the fist line and qtm wh...
3 years ago

Python for .NET "unable to find assembly" error

Python
I'm using CPython and I have a C# dll. I'm trying to use Python for .NET to make them talk. I can't use IronPython because I need to integrate this ...
3 years ago

Python lambda function to calculate factorial of a number

Python
I have just started learning python. I came across lambda functions. On one of the problems, the author asked to write a one liner lambda function for...
3 years ago

How to plot the rolling mean of stock data?

Python
I was able to plot the data using the below code: import pandas as pd import numpy as np import matplotlib.pyplot as plt url = "http://real-chart.fi...
3 years ago

Separating positive and negative values of pandas DataFrame

Python
I need to separately sum all positive and negative values in a column ie pos_values = [x for x in df.prediction_at_ohlcv_end_date if x > 0] neg_...
3 years ago