storing SNPs in the genotype file for each chromosome in a separate file I have already asked this question in another forum but have not got an appropriate answer, so wondering if anyone here can help me?
I have a big file with over 3 million columns (SNPs genotypes) and 800 rows (one row for each individual). 

The first row is the SNPs_ID name with the SNP position on each chromosome (see the example below please), in total there are 17 chromosomes. I want to extract SNPs for each chromosome and store them in a separate file.
I have done it with "R", but I am looking for a faster solution and I am wondering if anyone can help me to figure out another solution with bash, perl or python codes?

here is an example of my input file (SNPs on chromosome 1,2,3,4...,17)

"Ha412HOChr01:180159" "Ha412HOChr01:210724" "Ha412HOChr01:303270" "Ha412HOChr01:303280"....... "Ha412HOChr17:303402"
0 1 0 0 ......0
0 1 0 0 ......0
0 1 0 0 ......0
0 2 0 0 ......0
0 1 1 1 ......1
0 2 0 0 ......0


and this is an example of my desired output for example for chromosome 1:

out.chrom1
"Ha412HOChr01:180159" "Ha412HOChr01:210724" "Ha412HOChr01:303270" "Ha412HOChr01:303280" 
0 1 0 0 
0 1 0 0
0 1 0 0 
0 2 0 0 
0 1 1 1 
0 2 0 0 
0 0 0 0 
0 2 0 0
0 1 2 2
I believe a pandas approach would be fast enough (probably faster than any other Python approach without pandas).

After converting your table to a pandas data frame, you can do something like df.filter(regex=(".*Chr01")) for the first chromosome then write the resulting data to file with the to_csv() method.

import pandas as pd

data = pd.read_csv('input.txt', delimiter = "\t", index_col = False)

for i in ["Chr01", "Chr02", "Chr03"]:
    regex_pattern = ".*" + i
    print(data.filter(regex=regex_pattern))