[Tutor] reformatting data and traspose dictionary
Steven D'Aprano
steve at pearwood.info
Wed Apr 20 08:12:41 EDT 2016
On Wed, Apr 20, 2016 at 01:18:22PM +0200, jarod_v6--- via Tutor wrote:
> Hi!!!
> I have this problems
> I have a dictionary like this:
>
> [Name_file ::position] = lines
That doesn't look like Python syntax. What programming language is it
from?
> #Samplename::chr10-43606756-C-T::['chr10', '43606756', '.', 'C', 'T',
> #'100.00', 'PASS',
> #'DP=439;TI=NM_020630,NM_020975;GI=RET,RET;FC=Synonymous_V455V,Synonymous_V455V;EXON',
> #'GT:GQ:AD:VF:NL:SB:GQX', '0/1:100:387,52:0.1185:20:-100.0000:100']
I don't know what this means. It appears to be all comments starting
with #.
> And I want to obtain this tables
>
> Name_file on the row and position on the columns and the one parametr inside of lines
>
> ie.
> chr10-43606756-C-T ...
> Samplename ,Synonymous_V455V
I don't understand what this means either.
Remember, we cannot see your input data, and we don't know what output
data you want. Can you please show a *simplified* version? There is no
need to use the full complexity of your actual data.
And please explain what your input data is or where is comes from. For
example:
"I am reading data from a CSV file..."
"I am reading data from a text file..."
"I have a string..."
"I have a list of strings..."
and then show a *simplified* example:
data = "XXXXX:: ['a', 'b', 'c']"
and then show how you want that data to be processed:
output = {'a': 1, 'b': 2, 'c': 3} # the XXXX part is ignored
or whatever it is that you actually want.
--
Steve
More information about the Tutor
mailing list