How many stars within 5 parsecs? I've ran some scripts on some star catalogs, which counted the number of stars with a parallax greater than 200 mas, which should mean everything closer than 5 pc. The results are as follows:
original Hipparcos catalog 40
original Tycho catalog 10776
revised Hipparcos catalog 43
HYG database 64
How the heck are there that many stars according to the Tycho catalog? (I've checked the code many times, checked the values it was accepting and I used it as the base for the others.) Also, how can there be so much difference between the other three?
EDIT: If I discard negative parallaxes, the Tycho catalog has 5273 stars with parallaxes greater than 200 mas.
EDIT EDIT: Discarding all stars with the "dubious parallax" flag, 4213 remain.
EDIT EDIT EDIT: Discarding all stars with a quality of medium or worse, 161 stars remain.
 A: The Tycho and Hipparcos catalogs use different data layouts.
When I add a line print plx to your tycho_count.py script, the first 10 lines of output are:
9.6
35.1
6.4
4.4
-105.5
40.2
18.4
-2.0
-164.2
-4.6

It seems clear that those aren't parallax values.
You'll have to find out just how the tyc_main.dat file is organized and modify your script accordingly. (I wasn't able to figure that out from the documentation, but I didn't try very hard.)
(And since each line of tyc_main.dat consists of a number of fields delimited by '|' characters, it would be more robust to take advantage of that rather than use fixed offsets.)
UPDATE :
(Some of the above information turns out to be incorrect; I was looking at other data files.)
I've done some analysis on the hip_main.dat and tyc_main.dat files (the links are to gzipped versions of the files.
These both appear to have the same format.  They're plain text files with the parallax, in mas (milli-arc seconds) in columns 80-86, as described here.
hip_main.dat has 118,218 entries, of which 4196 (3.5%) have negative parallaxes with magnitude up to -54.95
tyc_main.dat is about 9 times the size, with 1,058,332 entries, of which 454,700 (43%) have negative parallaxes with magnitude up to -919.1 (which seems implausible).
A bit of Googling indicates that negative parallaxes can appear due to measurement errors, though I'm a bit surprised there are so many. (One site, to which I won't link, says that negative parallaxes are evidence for the geocentric model of the Universe.)
I also checked for Alpha and Proxima Centauri (Alpha is a double star). According to Wikipedia, Alpha Centauri's parallax is 747.1 ± 1.2 mas; Proxima Centauri's is 768.7 ± 0.3 mas.  Looking for similar values in both data files, I see:
hip_main.dat:
772.33
742.12
742.12

(presumably these are Proxima, Alpha A, and Alpha B, respectively), and:
tyc_main.dat:
701.5

The entry from tyc_main.dat is well outside the margin of error according to Wikipedia, and the other entries in that line indicate something in the Northern Hemisphere (Alpha and Proxima Centauri are about 60 degrees south of the equator).
My conclusion is that there's something wrong with the information in tyc_main.dat. I don't know what the problem is, but my advice is to ignore it and just use the information from the Hipparcos and HYG catalogs.
A: According to Research Consortium On Nearby Stars, as of January 2012, there were 50 known star systems including the Sun within 5 parsecs (parallax >200 milliarcseconds).  
The 50 star systems include 11 binary and 5 tertiary systems, the rest being single star sytems.  
In total there are 71 stars within 5 parsecs.  
