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:
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.)
(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
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:
(presumably these are Proxima, Alpha A, and Alpha B, respectively), and:
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.