text
stringlengths
226
34.5k
Possible incongruence in Sympy when assuming positive numbers Question: Using Sympy package version 1.0 on Python 2.7.11 I found what (to me) is an incongruence. This is the code I'm using: import sympy as sy from sympy.stats import Normal, density from sympy.assumptions import assuming, Q, ask ...
Frequency Response Scipy.signal Question: I'm learning digital signal processing to implement filters and am using python to easily implement a test ideas. So I just started using the scipy.signal library to find the impulse response and frequency response of different filters. Currently I am working through the book ...
Enabling `xrange` in Python3 for portability Question: I wrote a script which I wanted to enable for both Python 2 and Python 3. After importing `division` and `print_function` from `__future__`, my only concern was that my `range` returns a whole array in Python 2, wasting time and memory. I added the following 3 li...
What is the RegEx pattern for 24-06-2015 10:15:45: Aditya Krishnakant:? Question: What is the RegEx pattern for `24-06-2015 10:15:45: Aditya Krishnakant:` If you look at the whatsapp chat transcript, it looks like a mess. The purpose of this code is to print messages sent by a person in a new line (for better readabil...
Drawing lines between clicks on image with Matplotlib Question: I am trying to allow for a user to right click on an image once, and then again, and then the program will draw a line from the first click to the second. However, what I have now, inserts lines into my image seemingly randomly. They pop up and they are n...
Edit a .txt file, then convert to valid xml with python Question: I have lots of text files that I need to convert to .xml in order to be able to work with more efficiently (I am supposed to be doing a couple of language models to analyze English dialects) the files go like this: <I> <IFL-IDN W2C-001 #1...
How can I get a random unicode string Question: I am testing a REST based service and one of the inputs is a text string. So I am sending it random unicode strings from my python code. So far the unicode strings that I sent were in the ascii range, so everything worked. Now I am attempting to send characters beyond th...
AttributeError: 'file' object has no attribute 'encode' Question: Traceback (most recent call last): File "E:\blahblahblah\emailsend.py", line 26, in <module> msg.attach(MIMEText(file)) File "E:\blahblahblah\Python 2.7.11\lib\email\mime\text.py", line 30, in __init__ self.set_payloa...
Python update last line of file (stdout) Question: In Python program, I am redirecting `stdout` using below: sys.stdout = open("log_file.txt", "a",0) On certain condition I want rewrite the last line of the file. I have tried below: if (status=='SAME'): print '\r'+'Above statu...
Complex parsing of a string in Python Question: I want to parse a string with a format like this: [{text1}]{quantity}[{text2}] This rule means that at the beginning there is some text that can optionally be there or not, followed by a {quantity} whose syntax I describe just below, followed by more ...
Cross-validation on XGBClassifier for multiclass classification in python Question: I'm trying to perform cross-validation on a XGBClassifier for a multi-class classification problem using the following code adapted from <http://www.analyticsvidhya.com/blog/2016/03/complete-guide-parameter-tuning- xgboost-with-codes-py...
Celery: Received unregistered task of type <AsyncResult: [hash]> Question: In all of the similar problems I've seen on stackOverflow: * [Celery Received unregistered task of type (run example)](http://stackoverflow.com/questions/9769496/celery-received-unregistered-task-of-type-run-example) * [getting error Receiv...
moto with boto3 - Cannot build mock ELB Question: I'm new to moto and aws so I'm trying to wrtie some simple tests cases for a simple ELB checker in aws. I have read the moto page here: <https://github.com/spulec/moto> and I am following the boto3 guide here: <https://boto3.readthedocs.io/en/latest/reference/servic...
Efficiently convert a string of comma separated values to bytes Question: My `python3` program is receiving data from elsewhere as a string in the following format (the `...` means more data that I care to type out): data = "0,12,145,234;1,0,0,128;2,255,255,255;...;909,100,100,100;" I want to conve...
Including external shared intel's mkl library in c extension for python Question: I wrote a python c extension that uses routine from Intel's math kernel library (mkl). This is the first time that I write a c extension. I just learned that today. The c extension compiled. But when I import it in python, it says undefi...
openpyxl no attribution error Question: ## Python 3.5 openpyxl 2.4 Hi everyone, I got a simple but confusing problem here. FYI the API doc relating to worksheet is <http://openpyxl.readthedocs.io/en/default/api/openpyxl.worksheet.worksheet.html> Here is some simple code for testing. # -*- coding: utf...
generating UUID creation token for EFS Question: Is this sufficient for generating a UUID for using as a creation token for AWS CLI EFS ~ Elastic File System? Assuming you've been granted appropriate permissions. Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32 Type ...
Sum over parametric function Question: I am dealing with a parametric function like this: [![Parametric function](http://i.stack.imgur.com/RA0Dy.png)](http://i.stack.imgur.com/RA0Dy.png) and Ideally I would like to sum over the repeated x axis, as shown in the example. It is to say, for x~4.75, I see that the functio...
Find Customer from shopify with the particular range of date using shopify python api Question: How to import the customers from shopify with the particular range of date i.e importing the customers with the date filter ? Please refer the code below for importing customers without filter: shop_url = "ht...
Python OS symlink and .json.gz files Question: I am creating a symlink with Python. First, I check if the file exists and then create the symlink. import os project = 'test' if os.path.isfile("../../project/json/nodes1.json.gz"): os.symlink("../../project/json/nodes1.json.gz","../sim...
How to extract word frequency from document-term matrix? Question: I am doing LDA analysis with Python. And I used the following code to create a document-term matrix corpus = [dictionary.doc2bow(text) for text in texts]. Is there any easy ways to count the word frequency over the whole corpus. Sin...
Suggest a better counting process using Python | Pandas? Question: I'm using Python and Pandas to pull metrics (inbound calls, abandoned calls, etc.) from our call switch (csv format). The code works well but how I'm calculating the metrics feels kludige and I'm hoping someone can suggest a better way. Data looks like...
Scapy Installation fail on Windows 7 64 bit Python 3.5 Question: I have been going crazy with this installation but nothing seems to work. Python 3.5 is installed under : "C:\Program Files (x86)\Python35-32", so there is a space in between. I installed scapy in 2 ways: 1. pip3 install scapy-python3 2. From the w...
Python is unable to import library compiled with boost_python Question: I have the following sample program: // src/main.cpp #include <boost/python.hpp> char const* func() { return "String"; } BOOST_PYTHON_MODULE(bridge) { boost::python::def("func", func); ...
TypeError: a bytes-like object is required, not 'str' for Python Code Question: I get this when I try to run a code called NUT_check.py and this comes from line 69. I'm very unsure of what is happening as I didn't make this code myself, nor have I really used Python extensively. Line 69 is ending with a line of hyphens...
Can't load all friend Facebook API python Question: I'm new to Facebook API. I try the below code but it shows only 27 friends in my list friend(I have about 200). Why? Thanks for your help. import facebook token = 'my_token' graph = facebook.GraphAPI(token) friends = graph.get_connections(id...
How to convert Decimal() to a number in Python? Question: I have a JSON output that is `Decimal('142.68500203')`. I can use str() to get a string which is `"142.68500203"`. But I want to get a number output which is `142.68500203`. How to make the conversion in Python? Answer: It depends what you mean by "number", ...
Python - I dont know how to x works in this code Question: def test(x): def add(y): return x+y def mul(y): return x*y return "test" will var `x` go to GC? Answer: Python uses reference counting to manage _objects_ , not variables. If you want to know when the objec...
Python script to check server status Question: I want to check some service status (like MySQL, Apache2) using python. I wrote a simple script. #!/usr/bin/python from subprocess import call command = raw_input('Please enter service name : ') call(["/etc/init.d/"+command, "status"]) ...
Python dynamic import Question: I have a list of tuples like `[(module_name, module_abs_path)(mod2, path2), ...]` The modules are located in the 'modules' subdir where my script lives. I am trying to write a script which reads a conf file and makes some variables from the conf file available to the modules from the mo...
How would you simplify this program? Python Question: I wrote this program, which purpose is to visit the 18th link on the list of links and then on the new page visit the 18th link again. This program works as intended, but it's a little repetitive and inelegant. I was wondering if you have any ideas on how to make ...
Scraping a table from webpage with Python Question: from bs4 import BeautifulSoup from urllib import urlopen player_code = open("/Users/brandondennis/Desktop/money/CF_Name.txt").read() player_code = player_code.split("\r") for player in player_code: html =urlopen("https://ww...
How to get brighness percentage level from a histogram? Question: I wrote a python program that used scikit-image to return the histogram of an image: def get_hist(image): image = img_as_float(image) hs, dis = exposure.histogram(image) cdf = np.cumsum(hs) #cumulative distribut...
Appending to a Pandas Dataframe From a pd.read_sql Output Question: I'm coming from R but need to do this in Python for various reasons. This very well could be a basic PEBKAC issue with my Python more than anything with Pandas, PyODBC or anything else. Please bear with me. My current Python 3 code: im...
Python plotting percentile contour lines of a probability distribution Question: Given a probability distribution with unknown functional form (example below), I like to plot "percentile-based" contour lines, i.e.,those that correspond to regions with an integral of 10%, 20%, ..., 90% etc. ## example of ...
Rounding number with python Question: I was trying to calculate int((226553150*1023473145)/5.) using python and I got 46374212988031352 although it should be 46374212988031350. Answer: Remove the period for integer division: int((226553150*1023473145)/5) Comes out as 46374212988031350 for me. **...
jupyter notebook running kernel in different env Question: I've gotten myself into some kind of horrible virtualenv mess. Help?! I manage environments with `conda`. Until recently, I only had a python2 jupyter notebook kernel, but I decided to drag myself kicking and screaming into the 21st century and installed a pyt...
Flask: Mock call to external component returns a non serializable object for a HTTP response Question: I'm trying to learn how to use the Mock library in python. I have a Flask application which is connected to Redis via redis-py package. In the '/myapp/version' API of my app, I call a info() from redis-py, and forma...
How to get output of -interpreter-exec in GDB/MI? Question: I'm writing a wrapper for GDB/MI, however, I miss some commands in the MI interface. For example, the 'info variables' command. I can execute it with "-interpreter-exec console", but getting the output of it is tricky since it writes everything to console reco...
Why can't I create a custom user in Django using the UserCreationForm? Question: I am able to create a user from shell by importing the custom user model but when I apply the same method after submitting the form, the user is not created. Below are the codes of my custom user model, `UserCreationForm` and view. ...
open fp = io.BytesIO(fp.read()) AttributeError: 'str' object has no attribute 'read' in PIL/image.py Question: I'm a little new to Python especially Imaging library that I'm currently working with. I'm working with a facial recognition code and running it in my Raspberry Pi 2 B+ running Jessie. I'm using Opencv 2.4.9 a...
Amazon MWS Boto parsed XML missing values Question: Boto 2.40, Python 3.5 When querying Amazon MWS `get_competitive_pricing_for_asin` some values that are present in the raw XML are missing once parsed by Boto. The raw XML contains the number of offers for each condition in `NumberOfOfferListings` <Com...
Socket receiving in while 1 Question: I'm trying to create socket connections in python. I need to listen to server until it sends a message, thus I need to use `while True`. Client: import RPi.GPIO as GPIO import time import socket GPIO.setmode(GPIO.BOARD) pinLDR = 7 pinLED...
Tkinter : Button in frame not visible Question: I'm trying to implement a TicTacToe program. I am an absolute beginner in python. After viewing many tutorials and reading a few books, I have understood the basics of Python. I'm trying to get the buttons to display in a frame, but all I get is a blank window. [link for...
Python import CSV short code (pandas?) delimited with ';' and ',' in entires Question: I need to import a CSV file in Python on Windows. My file is delimited by ';' and has strings with non-English symbols and commas (','). I've read posts: [Importing a CSV file into a sqlite3 database table using Python](http://stac...
_tkinter.TclError: invalid command name ".54600176" error, what is going on? Question: I am new to python and am trying to code a simple game, but am continuously receiving this error message after updating the main game loop. Traceback (most recent call last): File "D:\python shell\Bubble Blaster...
Strange build error on Travis, local tests in tox work Question: I have a strange error on Travis, the builds of <https://travis- ci.org/edoburu/django-fluent-blogs> fail in Django 1.7 and lower with: from django.utils.six import python_2_unicode_compatible ImportError: cannot import name 'pytho...
Split into multiple files grouped by column value using AWK Question: My data frame is something similar to this in structure: A C 1 a 1 2 a 2 3 a 3 4 a 4 5 b 5 6 b 6 7 b 7 8 b 8 9 c 9 it has 16 million rows, I'm facing m...
Plotting graph using python and dispaying it using HTML Question: I want build an offline application using plotly for displaying graphs . I am using python(flask) at the back end and HTML(javascript) for the front end . Currently I am able to plot the graph by sending the graph data as JSON object to front end and bui...
How to write unittests for an optional dependency in a python package? Question: Based on availability of pandas package in working environment a method returns two different outputs : * A `pandas.DataFrame` if pandas is available * Otherwise a `numpy.recarray` object. How should I write unittest for this class ?...
Python3 segfaults when using ctypes on xlib, python2 works Question: The following code was scrounged up on the Internet years ago and works quite well in python2. It supplies the current idle time on the X server. import ctypes, os, subprocess class XScreenSaverInfo( ctypes.Structure ): _fie...
Dealing with durations defined by days, hours, minutes such as “1d 3h 2m” in Python Question: I have to validate a string with diffrent format of duration: 1d 8h 30m 12h 30m 0h 59m 59m 10h 0m 10h 1d 0h 0m 1d 0h 59m 1d 10h 0m 1d I am new in python and don't have a...
Auto it click exception: access violation reading 0x00000083 Question: My code should open a window from taskbar and then click a control from it. The problem is that after it opens the window I get the error : "exception: access violation reading 0x00000083".I am new to Python (and in programing) and I have no ideea w...
PySide Widget for 3dsMax and Modo Question: I'm trying to create a simple QT app using PySide and Python that I want it to run as a 3dsMax script, a Modo script and a stand-alone app if needed. So, I've saved the following files in my D:\PyTest. It's just a QLabel for this test. When I run it (_TestWidget.py_) as a st...
Adding new data to the neo4j graph database Question: I am importing a huge dataset of about 46K nodes into Neo4j using import option.Now this dataset is dynamic i.e new entries keep getting adding to it now and then so if i have to re perform the entire import then its wastage of resources.I tried using neo4j rest cli...
Django not detecting AngularJS Question: I have a Django project (that I created using PyCharm IDE). I have two HTML files and below is the code I have in those files. \-- header.html <!DOCTYPE html> <html lang="en" > <head> <title>This is my title</title> <meta charset="UTF-8"> {% l...
how to split a file of code into words, despite for string variables Question: Using python, how can I split a file, containing for example a code with methods, variables, etc. into words but leave the code's string variables as one unit string? For example: given the following python code inside a file: ...
Python3: using matplotlib to create figure, using a dictionary Question: I have got a dictionary in the form of `{test_size: (test_error, training_error)}` Here it is: {0.1: (0.94736842105263153, 0.90294117647058825), 0.2: (0.92105263157894735, 0.90397350993377479), 0.3: (0.82456140350877194, 0.924242424...
having an issua comparing comparing Strings @ python Question: Probably there is an easier way to do this, but i read there is no Switch/case in Python. I wanted to ask the user, to introduce a name of a color, and after calling the function that should take care of that, it should return the color code in RGB. My if s...
How to put dowloaded JSON data into variables in python Question: import requests import json import csv # These our are demo API keys, you can use them! #location = "" api_key = 'simplyrets' api_secret = 'simplyrets' #api_url = 'https://api.simplyrets.com/properties?q=%s&limit=1' ...
Obtain string inside curl bracket in python Question: Suppose I have a string like {"", "b", "c"}, // we are here I would like to extract the `{"", "b", "c"}` and/or `"", "b", "c"` part of it. Is there any simple prescription for it? Answer: You can use regex - `re.search`: import...
Receiving python json through sockets with java Question: I've been following multiple tutorials to connect a java code to python through sockets. Sending from java to python works great, with json array. However, I can't seem to receive things with java. I don't really understand how the listening should be done. Now...
How can I define global options with sub-parsers in python argparse? Question: I'm trying to figure out how to add global option in a sub-parser scenario with pythons arparse library. Right now my code looks like this: def parseArgs(self): parent_parser = argparse.ArgumentParser(add_help=False) ...
Can't get scipy.io.wavfile.read() to work Question: I am trying to read a .wav file into an array so that I can then plot the array and do a FFT. I got the file open with the wave module and now I am struggling. I was advised to use scipy.io.wavfile.read(filename, mmap=False) but am not having any luck. This function s...
quantile normalization on pandas dataframe Question: Simply speaking, how to apply quantile normalization on a large Pandas dataframe (probably 2,000,000 rows) in Python? PS. I know that there is a package named rpy2 which could run R in subprocess, using quantile normalize in R. But the truth is that R cannot compute...
Scraping on Python Question: I wanted to get the caption, no. of likes and comments of the recent 10 images of a particular user. Using below code I am just able to get the latest one. Code: from selenium import webdriver from bs4 import BeautifulSoup import json, time, re phantomjs_path = r...
exporting Python model results Question: Hi I’ve launched a random forest over a dataset imported as df. Now I would like to export both results (0-1 prediction) and predicted probabilities ( a two dimensions array) and match them to my dataset df. Is that possible? Until now I figured out how to export in a separate w...
line_profiler and kernprof does not work installed from pip and repro Question: I have tried what has been suggested. On the simplest of code, I get the familiar error that others have mentioned. The error is: @profile NameError: name 'profile' is not defined on the minimal code: ...
Choose one key arbitrarily in a dictionary without iteration Question: I just wanna make sure that in Python dictionaries there's no way to get just a key (with no specific quality or relation to a certain value) but doing iteration. As much as I found out you have to make a list of them by going through the whole dict...
Create XML file with python? Question: Here is my code: import xml.etree.ElementTree as ET root = ET.Element("rss", version="2.0", xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/", xmlns:content="http://purl.org/rss/1.0/modules/content/", xmlns:wfw="http://wellformedweb.org/CommentAPI/",...
Subprocess doesn't respect arguments when using multiprocessing Question: The main objective here is to create a daemon-spawning function. The daemons need to run arbitrary programs (i.e. use `subprocess`). What I have so far in my `daemonizer.py` module is: import os from multiprocessing import Pro...
Python MYSql.connector will not insert data Question: I am trying to insert some data into a a database I am making and it will not insert. I literally have used the same insert method on other code and it still seems to work, however this one refuses to. Help! from Bio import Entrez from sys import ...
Self scheduled Python script Question: I'm writing an Python script that calls a function that exports and imports spaces from the wiki tool Confluence. It has to run everyday, but we can't use cron so i'm looking for a way to schedule it by her self. I've created the following. I can already schedule it for the next ...
How to convert utf-8 values within a string to its correct character using python? Question: I would like to convert 'Lawrence_Warbasse_-_Dauphin%C3%A9_2013.JPG' to 'Lawrence_Warbasse_-_Dauphiné_2013.JPG' usig python Answer: You can use `urllib` to decode this: import urllib url = 'Lawrence_Warbass...
Updating records with Python 3 through API on Rails 4 application Question: I'm working on a Rails 4 / mongoid application which needs to expose APIs for other applications and scripts. I need to be able to update documents in one of the models through an API with Python 3 script. I'm a bit fresh with Python hence aski...
Stuck Coding a Python web crawler using BeautifulSoup Question: regarding this video by bucky roberts on programming a webcrawler in python: <https://www.youtube.com/watch?v=sVNJOiTBi_8> Here is my question: If i want to crawl a particular item but it isnt inside of < a> < /a> how can i do it? for ex. I inspected ...
SFrame Kmeans - Covert to Int, Float, Dict Question: I'm preparting data to run KMEAMS from Graphlab, and am running into the following error: tmp = data.select_columns(['a.item_id']) tmp['sku'] = tmp['a.item_id'].apply(lambda x: x.split(',')) tmp = tmp.unpack('sku') kmeans_model = g...
Numpy linspace and plotting, ValueError: an array element with a sequence Question: I was trying to get 60 lines joining center of the circle to 60 different equispaced points on the circumference in the following program, import matplotlib.pyplot as plt import numpy as np figure = plt.figur...
GenButton alignment wxpython Question: i am struggling to find an answer to the alignment of my GenButton, i have looked through the docs on wxpython website and cant see any option in there to address this, hopefully one of you guys can point me in the right direction, as i need to align my buttons to the center of th...
Concatinate to pandas data frame from OrderedDict - Python equivalent to R´s do.call(merge, list) Question: I have an ordered dictionary `"my_dict`", which gets filled with `n` time series during a loop. All `n` time series have the same length and are 1-dimensional. They all have a datetime index. In R I just run `do...
Imported module goes out of scope (unbound local error) Question: I am getting a strange "unbound local" error in a python package that seems to defy all logic. I can't get a MWE to reproduce it, but will try to explain succinctly and hope that someone might be able to offer some explanation of what is going on. For t...
Rabbitmq hello world connection doesn't work on localhost Question: I take hello world example from tutorial: import pika connection = pika.BlockingConnection(pika.ConnectionParameters( host='localhost')) channel = connection.channel() channel.queue_declare(queue='hello'...
gzipped data "not a gzipped file", but I think it is Question: This: H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ih7/Hu8WZXqZ101RLT/7aHe881GaL6fVrFhefPbRuj3fPvjo9zh63FTZ6tHp8jIvq1We0ivL5hE+++yjeduuHt2920zn...
Python Script with QGis - Python.exe Stopped Working Question: I purchased [this book called Building Mapping Applications with QGIS](https://www.packtpub.com/application-development/building-mapping- applications-qgis) and I am trying to work through one of the exercises. There is one script that I try to run that cra...
Automatically round Django's DecimalField according to the max_digits and decimal_places attributes before calling save() Question: I want to automatically round Django's DecimalField according to the max_digits and decimal_places attributes before calling save() function in ModelForm. currently using the following: ...
how to use function defined in other python file? Question: Lets say we have two programs `A.py` and `B.py` ,now `B.py` has two defined functions `calculator(x,y)` which returns `int` and makelist(list1)`which returns`list` Now,how can I access these functions in `A.py` (Python 3)? Answer: You will need to import t...
TFS REST upload attachment permission problems Question: I'm implementing TFS to our service. I'm using OAuth2, and it is working like a charm. I'm requesting permission scopes "**vso.work_write vso.project** " but somehow I'm not able to upload attachments. I'm getting 403 Forbidden from the server. As MS documentatio...
Form submit using Python lxml Question: I have a login page which is like this <form method="POST" name="DefaultForm" action="SOME_URL" onSubmit="return (isReady(this));" autocomplete="off"> <input name="action" type="hidden" value="SOME_VALUE"> <input name="serverTimeStamp" type="hidden" va...
python pandas simple pivot table sum count Question: I'm trying to identify the best way to make a simple pivot on my data: import pandas dfn = pandas.DataFrame({ "A" : [ 'aaa', 'bbb', 'aaa', 'bbb' ], "B" : [ 1, 10, 2, 30 ], "C" : [ 2, 0, 3, 20 ...
how add link to excel file using python Question: I'm generating an csv file that is opened by excel and converted to xlsx manually. The csv contains some path to .txt files. Is it possible to build the file path in such way that when the csv is converted to xlsx , they became clickable hyperlinks ? Thanks. Answer: ...
Automate the Boring Stuff with Python outdated instructions for launching Selenium browser Question: ### \--------Reply to Post being Labeled as a Duplicate question Since I am still learning the programming basics I was not sure whether the material on the alternate post was relevant especially since I was on the fir...
'Graph' object has no attribute 'SerializeToString' on Windows Docker Question: I'm trying to run tutorials : <https://www.tensorflow.org/versions/master/tutorials/mnist/tf/index.html> I got below error message: root@db411995c219:~/pjh# python fully_connected_feed.py Extracting data/train-image...
Import JSON data into single cell in google sheets Question: I am wondering if anyone can give me an example on how to gather data from a JSON file, and import it into a single cell in google sheets? It does not need to be formatted or copied to multiple cells, it simply needs to take the entire contents of the JSON an...
Run python script only if it's not running Question: I want to launch a python script from another python script. I know how to do it. But I should launch this script only if it is not running already. **code:** import os os.system("new_script.py") But I'm not sure how to check if this script ...
How to fit data to normal distribution using scala breeze Question: I am trying to fit data to normal distribution using scala breeze , python scipy alternative way is : `from scipy.stats import norm` `mu,std = norm.fit(time1)` I am looking for alternative way to do same in scala using breeze Answer: Looking at th...
Python - Parse XML or conver to JSON Alexa API Data Question: I have some data in xml coming in through alexa. It looks like this: <!-- Need more Alexa data? Find our APIs here: https://aws.amazon.com/alexa/ --> <ALEXA VER="0.9" URL="yahoo.com/" HOME="0" AID="=" IDN="yahoo.com/"> <SD> ...
How to scrape for specific tables and specific rows/cells of data python Question: So this is my first python project and my goal is to scrape the final score from last night's Mets game and send it to a friend through twilio, but right now I'm having issues with extracting the scores from this website: ...
Java TCP server not receiving packets until client disconnects Question: I have a TCP server in Java and a client written in Python. The python client simply sends 10 packets waiting 2 seconds in between each send. However, the java server doesn't seem to recognize the packets until the python script terminates, in whi...
pick month start and end data in python Question: I have stock data downloaded from yahoo finance. I want to pickup data in the row corresponding to monthly start and month end. I am trying to do it with python pandas data frame. But I am not getting correct method to get the starting & ending of the month. will be gre...
ImportError: libboost_iostreams.so.1.61.0: cannot open shared object file: No such file or directory Question: I am using Anaconda as my main python distribution (though also have the system's default python installed) so have to compile graph-tool from source to get it to work with Anaconda. I am using Ubuntu 14.04 s...