Search into my column on tsv file with pandas?
Hello everyone. during my internship I have to handle tsv files. I would absently do it with a python script to perform my skill.
As you can see my third column are numbers. but what I want is just to keep genotype O/1 and 1/0 and not 0/0 in this column. However I dont know which method I can use into my third column to find this type of genotype.
Thank you in advance for your assistance with this.
import pandas as pd
mon_data = pd.read_table('2zaza.del.tsv', header=None)
genotype = mon_data.loc[:,3]
genotype
0 0/0:-0,-9.03,-180
1 0/0:-0,-3.61,-72
2 0/0:-0,-7.22,-144
3 0/0:-0,-7.22,-144
4 0/0:-0,-11.44,-228
5 0/0:-0,-6.62,-132
• 1,416 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Take a look at the
.str.splitcommandhttps://cmdlinetips.com/2018/11/how-to-split-a-text-column-in-pandas/
Hello behzadi.milad!
We believe that this post does not fit the main topic of this site.
Pure python question, please search StackOverflow
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!