text
stringlengths
226
34.5k
Spyder Variable explorer how to show custom data types? Question: The Spyder Variable explorer looks very interesting to me, but currently it can show only a limited number of data types: <https://pythonhosted.org/spyder/variableexplorer.html> If I define a **custom** class/data type, its instances will not show in th...
How should logging be used in a Python package? Question: I am currently developing a package which can be used without writing any new code and the modules can be used to develop new code (see [documentation](https://pythonhosted.org/hwrt/)). Many of my modules use [`logging`](https://docs.python.org/2/library/loggin...
Python - Merging 2 lists of tuples by checking their values Question: I have lists like this: a = [('JoN', 12668, 0.0036), ('JeSsIcA', 1268, 0.0536), ('JoN', 1668, 0.00305), ('King', 16810, 0.005)] b = [('JoN', 12668, 0.0036), ('JON', 16680, 0.00305), ('MeSSi', 115, 0.369)] I want the resultant...
How do I execute Maya script without lauching Maya? Question: For example, I want to launch a script that creates a poly cube, export it to .stl or .fbx from the command line. I can do it in Python by using the Maya standalone but it cannot handle exporting to other formats than .ma apparently Answer: Why of course ...
Python tries to install everything into /lib on os x Question: I think that somehow the path /lib is stored in my python dist where it should not be. It started when I was having troubles installing python modules using pip. Pip seemed to install everything into /lib/python2.7/site-packages where python could not find...
xml string is enclosed with b'<xml_string>' while generating from dictionary using dicttoxml module Question: I am using [dicttoxml](https://pypi.python.org/pypi/dicttoxml) module for converting dictionary into xml. **Code:** cfg_dict = { 'mobile' : { 'checkBox_OS' : ...
How to handle dependency on scipy in setup.py Question: I am trying to create a `setup.py` for a project that depends on SciPy. The following `setup.py` reproduces this: setup( name='test', version='0.1', install_requires=['scipy'] ) When installing this using `python se...
Python Requests: Don't wait for request to finish Question: In Bash, it is possible to execute a command in the background by appending `&`. How can I do it in Python? while True: data = raw_input('Enter something: ') requests.post(url, data=data) # Don't wait for it to finish. p...
urwid watch_file blocks keypress Question: I have the following urwid program that displays the key pressed, or any line that comes in from the Popen'd program: #!/usr/bin/env python import urwid from threading import Thread from subprocess import Popen, PIPE import time import os ...
Python - search and replace vowels in string Question: i need to write code in Python that will be able to detect if a certain character in a string is there and replace it with another character of my choice. for example, i need to replace all vowels in a string with "$&@", so after the string "hello world" goes throu...
Python nosetests runs tests twice Question: I'm setting up a Python Continuous Integration server, using Jenkins, and nosetests keeps running the same tests twice. I'm not importing the tests anywhere. Here's the command I'm running: nosetests --with-xcoverage --with-xunit --all-modules --traverse-namesp...
How do I plot a histogram using Python so that x-values are frequencies of a spectra? Question: I looked at the python "matplotlib.pylab" library, and allows me to plot histograms with the "plt.hist" function. The problem is that it only takes one data argument, which is an array. In my case, I want to plot a histogram...
Python package naming issue Question: I have a python package named gutils, which contains a lot of useful tools for development, some of them are generic, some of them use reportlabs and the most important part forms a layer of abstraction on top of django, customizing a lot of default behaviour I would like to keep ...
Too many values to unpack using NLTK and Pandas in Python Question: I am trying out different things to make the NLTK's naive bayes work using the NLTK and Pandas modules, but I am getting the "too many values to unpack" error. import pandas as pd from pandas import DataFrame, Series import numpy...
Swapping two characters in a 2D array in python? Question: So, I'm brand new to programming, and this is frustrating me! What I want to do is be able to import a 4x8 text file, and turn the text into a 2D list so that I can swap two characters. For example, if the imported text file looks like this: OOOO...
Understanding slicing in python Question: import numpy as np x = np.arange(10**5) for i in xrange(x.size): foo(x[3000:40000]) and just another version of the code above import numpy as np x = np.arange(10**5) slice_of_x = x[3000:40000] for i in xrang...
How to let CGI scripts work on MacOS 10.10 Yosemite Question: I followed this [instuctions](http://coolestguidesontheplanet.com/get-apache- mysql-php-phpmyadmin-working-osx-10-10-yosemite/) to set up Apache on MacOS 10.10 Yosemite. Now I want to let CGI scripts work on it, but something goes wrong. At the URL `http:/...
Memory usage of a single process with psutil in python (in byte) Question: How to get the amount of memory which has been used by a single process in windows platform with psutil library? (I dont want to have the percentage , I want to know the amount in bytes) We can use: psutil.virtual_memory().used ...
Python, how to slice a netcdf file. Question: I am trying to slice a variable from a netcdf file and plot it but I am running into problems. This is from my code: import numpy as np from netCDF4 import Dataset Raw= "filename.nc" data = Dataset(Raw) u=data.variables['u'][:,:,:,:] pri...
execute robot keyword from python using robotframework api Question: Writing complex robot keywords in robot language is sometimes very time consuming because robot language is not a real programming language. I would like to write my keywords in python and only expose simple html tables in robotframework language. The...
send a file to multiple device at same time via python&bluez Question: i want send a file to multiple device at same time via python ... my code : import bluetooth from lightblue import * import select import threading def send(fileaddress,bladdress,pushport): client = obex.O...
import a python module whose location is unknown Question: I would like to import a function (function.py) from a given module in python (MOD.py), whose location I do not know. For it, I have performed two steps: First step, I get the path to the directory that contains the module: path = subprocess.che...
Convert following data to JSON format in python Question: I have a file with following content which is generated by some other program. Please note that each one has a new line character at the end. {'a':1,'b':534} {'a':4,'b':882} {'a':2,'b':964} . . so on... How do I convert t...
Python word in file change Question: I am trying to change the words that are nouns in a text to "noun". I am having trouble. Here is what I have so far. def noun(file): for word in file: for ch in word: if ch[-1:-3] == "ion" or ch[-1:-3] == "ism" or ch[-1:-3] == "ity"...
Meaning of Stanford Spanish POS Tagger tags Question: I am tagging Spanish text with the Stanford POS Tagger (via NLTK in Python). Here is my code: import nltk from nltk.tag.stanford import POSTagger spanish_postagger = POSTagger('models/spanish.tagger', 'stanford-postagger.jar') spanish_pos...
Django Gunicorn ImportError: No module named django.core.wsgi Question: I have created a Django application but now have plans to use some asynchronous (real-time) functionality in some areas of the site. After doing some research I think I should use `gevent-socketio` and therefore it is required I switch the applicat...
Uniformly shuffle 5 gigabytes of numpy data Question: I'm training a neural network with about five gigabytes of data stored as `numpy` arrays. The data are split into chunks of 100000 rows, and I've done six cycles of training over all the chunks in a random order. Unfortunately, the network has begun to overfit. I th...
How to use java libraries in python processing Question: Im using processing in python mode but I want to use the processing library sound. But I dont know how to import this into my program in python syntax. In java its like this: Import processing.sound.*; Thanks Answer: You can use `add_library(processing.sound)`....
python pandas dataframe from file Question: I want to create a dataframe object from a file. The file looks something similar to this Gibberish Header1 Gibberish Header2 Gibberish Header3 Gibberish Header4 (etc)... TAG THING_I_WANT_AS_COLUMN_NAME Column1 1.0 # I'll want this index as...
Python - Mechanize input text in form Question: I'd like to input some text in the text field of a form. This is my current code. What should I do next? import re from mechanize import Browser br = Browser() br.open("xyz.com") formcount=0 for frm in br.forms(): if str(frm.a...
nbconvert markdown not searching predefined images Question: I was wondering why ipython nbconvert --to markdown not searching the image in directory first. If i do this in my tes.ipynb: from Ipython.display import Image Image('tes_files/1.jpg') then if i execute command ipython...
Start a process on another computer on the network Question: I'm required to start a series of python scripts and/or other windows executables. Some of these require a Windows system, others require a Linux machine. Currently there are designated machines to run the OS-dependent programs. So I know where I want to sta...
How to debug ImportEror "No Module named ..." Question: I am using Django Rest Framework. When I try to go to the swagger docs page, I am getting ImportError: No module named drf_compound_fields from serializers.py where I try to import the following from drf_compound_fields.fields import ListF...
How does one create iterateable lists of objects in C++? Question: I'm starting out C++ coming from Python, so I'm pretty much just scrolling through the basics. Problem occurs when I try to make an array with objects in it. In Python I would have a class Car with the attributes `color` and `year`: myCar...
How to install aggdraw with Python 2.7 Question: I'd like to use aggdraw with Python 2.7. (Is this a dumb idea anyway? I've seen a nice aggdraw example, but I don't want to regress to Python 2.6. Is there an equivalent drawing library working with Python 2.7?) I have Python 2.7.8 64bit installed on a Windows 7 Enterpri...
Compare two CSV files and print the rows that are different Python Question: I'm trying to compare two csv files that are like below English.csv i am is was were Dictionary.csv i,insomnia d,disease bc,breast cancer I'm trying to compare the first columns in ...
Search a delimited string in a file - Python Question: I have the following read.json file {:{"JOL":"EuXaqHIbfEDyvph%2BMHPdCOJWMDPD%2BGG2xf0u0mP9Vb4YMFr6v5TJzWlSqq6VL0hXy07VDkWHHcq3At0SKVUrRA7shgTvmKVbjhEazRqHpvs%3D-%1E2D%TL/xs23EWsc40fWD.tr","LAPTOP":"error"} and python script : imp...
Python sockets not responsered Question: my code send a http request using sockets and then save the response.It works for me yesterday, but today i cant receive response. I need to use sockets not httplib or urllib. I dont know if code is not working or my python install is crazy. thanks! import socket ...
Python Guessing Game Correct answer being printed even when player gets answer right Question: So I have recently started programming python and I have one issue with this code. When the player gets the answer incorrect after using all their lives it should print the answer which it does but only the first time the lay...
Exception raising does not reflect in test case even though raised as seen in logs Question: I'm practicing TDD in Python and came across a problem in testing whether an exception is raised. Here is my `test_phonebook.py` with `test_add_empty_name_raises_exception` which fails. import unittest impor...
Using User Input to control parameters in a Random number Generator Question: I am attempting to write a program that generates random numbers, asks how big you want it, between 1-4 for example, then I want it to ask how many numbers you want and finally ask you if you want to run it again. I am attempting to grasp the...
GoogleAppEngineLauncher: database disk image is malformed Question: I've written a small application for Google App Engine and each time I want to run my app I have the following error: *** Running dev_appserver with the following flags: --skip_sdk_update_check=yes --port=13080 --admin_port=8005 ...
Parse wget log file in python Question: I have a wget log file and would like to parse the file so that I can extract relevant info for each log entry. E.g IP address, timestamp, URL, etc. A sample log file is printed below. The number of lines and detail of information is not identical for each entry. What is consist...
Raw TCP Listen Socket on Cloud or Web Server Question: I have hardware that connects to raw TCP socket on any given IP and port combination. It then continually sends characters. The following piece of Python code may give you an idea of what the hardware does. import socket serverIP = '*server ...
Why the code produces this answer? [Python] Question: Basically I'm setting up a code, but for some random reason it always says the answers are wrong. So, say it is '10 x 10' & I would say it is '100' The code however says back to me, '**`I'm sorry the answer is 100`** ' **Why the code produces this answer?** Here...
Python3 - tkinter importing and using module Question: I am having trouble importing and using a module I have created. I have patcher.py and I would like to import modules from patches.py but I get an error when trying to import and use disable_removecd. I am now a little confused on how to set it up properly and how ...
Python Zelle Graphics - Recursive functions in drawing? Question: ![the goal](http://web.cs.swarthmore.edu/~grace/cs21/f14/labs/09/diamonds.jpg) ![enter image description here](http://i.stack.imgur.com/ZMMaD.png) import graphics def main(): window = graphics.GraphWin("x", 600, 400) c...
tkinter grid: distribute rows and columns over frame height and width Question: Using python 3.4.1 on Mac OS I'm trying to distribute label and entry widgets equally using the grid geometry manager in a subframe called 'lowerframe'. My current MWE is shown below: #!/usr/bin/env python3 from tki...
Python: error when installing lxml on OS X Question: For whatever I'm installing with pip, I got this: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)...
How to pass a class/module definition into another file Question: I'm a beginner in OOP Python and I just wanna know this: This is **file.py** : class Card(): def __init__(self, rank, suit): """Initialization method""" self.rank = rank self.suit = suit ...
Python: Remove text between <Table></Table> from text Question: I am still relatively new to the use of `regex` in Python and I am struggling to find a way to remove the content between the tags in a very simple .txt file. See this [file](https://www.dropbox.com/s/tnpm55xe1ovh7ow/0001047469-98-044981.txt?dl=0) for exam...
Python TypeError: coercing to Unicode: need string or buffer, file found Question: I am into learning Python, with a C- language background. Sorry, if my problem is 'naive' or 'too simple' or 'didn't worked enough'. In the below code, I want to practice for future problems, the removal of specific rows by the 'set' da...
Python Matplotlib custom style error Question: i'm trying to use a custom matplotlib-style But it does not work: As mentioned here: <http://matplotlib.org/users/style_sheets.html> i tried the following: import matplotlib.pyplot as plt print plt.style.available `matplotlib.pyplot` works fine...
Convert redis hash to python dict? Question: Suppose I have a python dict `aa = {"name": "nilesh", "age":29}` When I store it in redis hash, all datatypes changes to string. import redis r = redis.StrictRedis() r.hmset("nilesh_123", aa) bb = r.hgetall("nilesh_123") Now bb comes as `{'ag...
Error: Attribute error in TCL Question: I am trying to create an application in Python GUI using tkinter. Here is the code I'm using for the GUI part. Whenever I try to access my Entry Widget I get error. Ex:Sin_put.get() should give me the text in the Entry widget but it gives me an error AttributeError: 'NoneType' ...
Confused about majorclust algorithm Question: I would like to write my own code in matlab for "majorclust" algorithm. I have document pairs having their cosine similarity. When i search through the web, i encounter this web site. <http://muse-amuse.in/~baali/MajorClustPost.html> In the example(written in Python) in t...
sorting dictionary values in python - descending alphabetically Question: I have a dictionary:- higharr = {'Alex':2, 'Steve':3, 'Andy':4, 'Wallace':6, 'Andy':3, 'Andy':5, 'Dan':1, 'Dan':0, ...
How I can run /myapp/my_app.py by default when accessing `localhost` using Bottle? Question: **Desired Behaviour** I want to serve content created by the file at: /myapp/my_app.py when accessing `localhost`. **Question** I know that if I add the following to `test.py` and run the file directly, ...
Getting output from a Python script subprocess Question: This may be a stupid question but I have a Python script that starts a subprocess (also a Python script) and I need that subprocess to return three integers. How do I get those return values from the Python script that starts the subprocess? Do I have to output t...
Selenium WebDriver tests with JavaScript disabled Question: One of our internal applications (written in _angularjs_) has a special error box appearing if javascript is disabled in the browser (using [`noscript`](https://developer.mozilla.org/en- US/docs/Web/HTML/Element/noscript?redirectlocale=en- US&redirectslug=HTML...
Where is mimetools.choose_boundary function in Python3? Question: I currently want to use the following piece of code in Python3, but found the function `mimetools.choose_boundary` to be deprecated, how to change the code and make it works? import re from urllib.request import urlopen, Request im...
Conda doesn't find existent binstar package Question: I'm trying to install the hdf5storage package for my Python 3 installation on a 64-Bit Windows 8 machine using Anaconda. Just to make sure that everything was up to date, I did a C:\Users\Baeuerle>conda install binstar Fetching package metadata: ....
Regular string of hex values to binary string Question: I am writing a file-data searching script and want to allow the user to search for a string of hex values (via `argv`). I had to switch from PHP to Python because the maximum value of integers are (too) limited on 32-bit PHP/machines. In PHP I could just do: ...
"_csv.Error: line contains NULL byte" in CSV reader from STDIN Question: There are many StackOverflow questions about this error when reading from a **_CSV_** file. My problem is occurring while reading from **_STDIN_**. `[Most SO solutions talk about tweaking the open() command which works for opening CSV files - not...
Alarm will not be triggered in Python 2.7 program Question: I'm trying to make a command line alarm clock application. The way it's supposed to work is that when the current hour and the current minute are the same as the hour and minute you want to wake up at, it will exit the `while` loop and wake you up. However, wh...
Comparing row values in pandas dataframe Question: I have data in a pandas dataframe where two columns contain numerical sequences (start and stop). I want to identify which rows have stop values which overlap with the next rows' start values. Then I need to concatenate them into a single row so that I only have single...
Script to compress all pdf files in a directory Question: I wish to compress all pdf files in a directory using ghostscript. I thought of using python to read files and the gs command that compress pdf is from __future__ import print_function import os for path, dirs, files in os.walk("/home/mari...
Infinite loop - Rubiks cube scrambler Question: I'm having a little problem with Rubiks Cube scrambler in python. There is my code: __author__ = 'Mors' from random import randint moves = ["F", "F'", "R", "R'", "L", "L'", "U", "U'", "D", "D'", "B", "B'", "F2", "R2", "L2", "U2", "D2", "...
How do we use sleep() in Linux to keep our CPU usage reasonable while still having decent timing accuracy? Question: # The Problem I'm trying to test a system that uses UDP packets to communicate at a predetermined rate. I want to be able to test this system using a Python test harness with a set packet rate. Sample r...
GAE SDK 1.9.5 and an InvalidCertificateException Question: Trying to import testbed from GAE SDK 1.95 with Python2.7.8 on osX Maverics 10.9.5 and I'm getting a InvalidCertificateException error. from google.appengine.ext import testbed File "/usr/local/google_appengine/google/appengine/ext/t...
How to import one day old logs Question: I am new to Python and need some help in being able to import done day old logs. Below is the script I have come up with, but not sure if it is working or if there is a better way to do this. def fileCreation(path): now = time.time() oneday_ago...
No module named flask while running uWSGI Question: I have a very simple flask app (myflaskapp.py): from flask import Flask app = Flask(__name__) @app.route('/') def index(): return "<span style='color:red'>I am app 1</span>" If I run: uwsgi --http-socke...
Python stdout logging: terminal vs bash file Question: I am not expert in Bash and Python, so this question might appear silly. I have a Python script called `learn.py` and I noticed two different behaviours of the standard output, when redirected to a log file. If I call this from terminal, I can see the log file si...
Creating an update function within my display class in Python Question: So I am trying to code it when I call my myDisplay.update() function I can pass whatever game element I want to update into it, to display the image. For example I made a player with a player class, and I want to pass it into myDisplay.update(playe...
How do I bin and categorize numbers in Python? Question: I'm not sure if binning is the correct term, but I want to implement the following for a project I am working on: I have an array or maybe a dict describing boundaries and/or regions, for example: boundaries = OrderedDict([(10,'red'),(20,'blue'),(55,'purple')])...
Running a .py file in python that requires input Question: the question I have is really a simple one, and maybe the issue is just myself not knowing the correct parameters for python with Linux. The file I am running uses input from the operator both to run the program, and also to get the information to convert, whi...
load an already written GTK python codes into a GUI designer Question: I want to change the interface of a written application. this application is written in python and GTK . I don't want to change the codes manually by myself but although I need an interface designer so I can import this application to it and the gra...
Find startup folder in windows 8 using python Question: I have a code that adds a batch file to the startup folder so that it runs when the computer starts up. my code is the following: path = 'C:\\Users\\%s\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\Batch.BAT' %win32api.GetUse...
TypeError: 'bool' object is not callable - python Question: I'm trying to implement a simple maths game where the user is given random numbers and operators then they have to work out the answer, I found sources on the internet that suggested using the operator module, which is why i used it, if there is a more efficie...
Python variable not recognized in if-statement Question: Here is all the code, but in main(), a while loop checks if on_title_screen is true, and if it is, displays the title screen, but if not, displays the game. However, after starting the program, running the game, and returning to the title screen, attempting to pr...
How to parse a CLI command output (table) in python? Question: I am a newbie to parsing. switch-630624 [standalone: master] (config) # show interface ib status Interface Description Speed Current line rate Logical port state Physical port...
Python: Appending to lists as keys within a dictionary Question: def classify(kingdom, species): """ (list of str, list of str) -> dict classifies each of the species in the right class in the format of a dictionary PRECONDITION: len(kingdom) = len(species) >>>classify(['Animal', 'Animal'...
invalid literal for int() with base 10 - django - updated Question: I am a django beginner, and I am trying to make a child-parent like combo box, (bars depends on city depends on country) and I get this error. **UPDATE: Changed the model and the default value for the foreign key, but still the same error. Any help? t...
Getting Deeper Level JSON Values in Python Question: I have a Python script that make an API call to retrieve data from Zendesk. (Using Python 3.x) The JSON object has a structure like this: { "id": 35436, "url": "https://company.zendesk.com/api/v2/tickets/35436.jso...
Python: How to create a directory and overwrite an existing one if necessary? Question: I want to create a new directory and remove the old one if it exists. I use the following code: if os.path.isdir(dir_name): shutil.rmtree(dir_name) os.makedirs(dir_name) It works, if the directory do...
I need the server to send messages to all clients (Python, sockets) Question: This is my server program, how can it send the data received from each client to every other client? import socket import os from threading import Thread import thread def listener(client, address): ...
Django/Python: CSV for-in loop overriding first row each time through Question: class CSVDownload(View): """ Prepares CSV file version to download """ #more code here f = StringIO.StringIO() writer = csv.writer(f, dialect='excel') for v in vi...
How can JSON data with null value be converted to a dictionary Question: { "abc": null, "def": 9 } I have JSON data which looks like this. If not for null (without quotes as a string), I could have used `ast` module's `literal_eval` to convert the above to a dictionary. A dictionary in Pytho...
Run python script from enthought canopy with an absolute path as an argument Question: I would like to run a python script from enthought canopy v1.5.0.2717, either in mac or windows, and provide a absolute file path as an argument using the run configuration dialog. In the run configuration I put an argument (for exa...
Compiling Qt statically on Windows XP and MinGW fail. Is it possible to achieve? Question: I need to compile Qt statically. I have to do it on a virtual machine running Windows XP. Because of this requirement, I can't use the PowerShell 3.0 script suggested in the wiki page [How to build a static Qt for Windows/MinGW](...
How to clean images in Python / Django? Question: I'm asking this question, because I can't solve one problem in `Python/Django` (actually in pure Python it's ok) which leads to `RuntimeError: tcl_asyncdelete async handler deleted by the wrong thread`. This is somehow related to the way how I render `matplotlib` plots ...
why boto not find config the file (Credentials) Question: i Created new config file: $ sudo vi ~/.boto there i paste my credentials (as written in readthedocs for botp): [Credentials] aws_access_key_id = YOURACCESSKEY aws_secret_access_key = YOURSECRETKEY im trying to c...
Parse XML in Python with lxml.etree Question: How can I parse this site (<http://www.tvspielfilm.de/tv- programm/rss/heute2015.xml>) with python to get for example the tv programm for today on SAT at 20:15? I've tried the Python library lxml.etree, but I failed: #!/usr/bin/python import lxml.etree as...
How can i move files from one directory to another? Question: I am beginner in python . I want to move some files from one directory to another. I just now i have to use some modules like Os and Shutil. and i write this code but it return an error: import shutil import os source = os.listdir("/tm...
Regex not matching \t\n\r\f\v in Python Question: I have a list of a strings: content = ['***************************************\n\t', 'ADVENTURE', '*', 'Solving', 'it', 'in', 'easy', 'steps', '*\n\t', '*\t\t\t\t', '*\n\t', '*\t\t\t\t', '*\n\t', '***************************************\n\t\t', 'FROM:', ...
Behaviour of rotating image between kivy and python Question: I'm having problem understanding what kivy is doing behind the scenes when using the kivy language when rotating images and moving them. Below is a code that's is supposed to draw two images in a 45 degree angle on the screen and then for every mouse click r...
create android project and android-support-v7-appcompat is not included in lib(eclipse) Question: I fixed the problem. I used the workspace which was given by a python professor. I guess some sets do not match. After changing workspace, it works. Thank all you guys answer. When i create a new android project, i ask ec...
ipython notebook pandas max allowable columns Question: I have a simple csv file with ten columns! When I set the following option in the notebook and print my csv file (which is in a pandas dataframe) it doesn't print all the columns from left to right, it prints the first two, the next two underneath and so on. I u...
Merging Pandas DataFrames on categorical series Question: I'm trying to understand if pandas supports merging DataFrames on columns of categorical data (i.e. dtype="category"). I do most of my data work in R, but am trying to do more work in Python/pandas. In R, merging on factors (analogous to the categorical dtype) ...
issues with python xml parsing Question: I'm new to xml and REST but have some basic knowledge with python. I'm facing some issues while trying to parse the attached xml file. I use Beautifulsoup library to parse the file and, for an unknown reason, I can access different fields of entries 2 and 3 but not entry 1, whi...