Re: data frame

2016-12-24 Thread Val Krem via Python-list
Thank you Peter and Christ. It is was a white space and the fix fixed it. Many thanks. On Friday, December 23, 2016 5:26 PM, Peter Otten <__pete...@web.de> wrote: Val Krem via Python-list wrote: > Here is the first few lines of the data > > > s1.csv > size,w1,h1 > 512,214,26 > 123,250,34 >

Re: data frame

2016-12-23 Thread Peter Otten
Val Krem via Python-list wrote: > Here is the first few lines of the data > > > s1.csv > size,w1,h1 > 512,214,26 > 123,250,34 > 234,124,25 > 334,213,43 Did you put these lines here using copy and paste? The fix below depends on the assumption that your data is more like size, w1, h1 512, 214,

Re: data frame

2016-12-23 Thread Val Krem via Python-list
Here is the first few lines of the data s1.csv size,w1,h1 512,214,26 123,250,34 234,124,25 334,213,43 and the script a=pd.read_csv("s1.csv", skipinitialspace=True).keys() print(a) i see the following Index(['size', 'w1', 'h1'], dtype='object') when I wanted to add the two columns;

Re: data frame

2016-12-23 Thread Peter Otten
Val Krem via Python-list wrote: > Hi all, > > #!/usr/bin/env python > import sys > import csv > import numpy as np > import pandas as pd > > a= pd.read_csv("s1.csv") > print(a) > > size w1 h1 > 0 512 214 26 > 1 123 250 34 > 2 234 124 25 > 3 334 213 43 > 4 a45 223 3

Re: data frame

2016-12-23 Thread Chris Angelico
On Sat, Dec 24, 2016 at 7:39 AM, Val Krem via Python-list wrote: > a= pd.read_csv("s1.csv") > File "pandas/src/hashtable_class_helper.pxi", line 740, in > pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13107) > KeyError: 'w1' > > Can someone help me what the problem is? Can you

data frame

2016-12-23 Thread Val Krem via Python-list
Hi all, #!/usr/bin/env python import sys import csv import numpy as np import pandas as pd a= pd.read_csv("s1.csv") print(a) size w1 h1 0 512 214 26 1 123 250 34 2 234 124 25 3 334 213 43 4 a45 223 32 5 a12 214 26 I wanted to create a new column by adding the t

Re: JSON to Pandas data frame

2016-06-25 Thread hasan . diwan
David Shi writes: >How to convert a JSON object into a Pandas data frame? You can use read_json -- http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_json.html to read it into a dataframe. Or you can read the json into python objects and use read_records to create a pan

JSON to Pandas data frame

2016-06-25 Thread David Shi via Python-list
How to convert a JSON object into a Pandas data frame? I know that for XML, there are XML parsers. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: Reg: Data frame conversion

2016-02-17 Thread Rob Gaddi
Sushanth wrote: > ​i need to convert r data fr​ame to pandas dataframe and vise versa > Now, now, let's at least _try_ to help. http://lmgtfy.com/?q=convert+r+data+frame+to+pandas -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently o

Re: Reg: Data frame conversion

2016-02-17 Thread Mark Lawrence
On 17/02/2016 18:00, Sushanth wrote: ​i need to convert r data fr​ame to pandas dataframe and vise versa It is very easy, just write some code. When you have finished, please show us your results. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for o

Re: Reg: Data frame conversion

2016-02-17 Thread Tony van der Hoff
On 17/02/16 18:00, Sushanth wrote: ​i need to convert r data fr​ame to pandas dataframe and vise versa Wow! How do you plan to do that? -- Tony van der Hoff| mailto:t...@vanderhoff.org Buckinghamshire, England | -- https://mail.python.org/mailman/listinfo/python-list

Reg: Data frame conversion

2016-02-17 Thread Sushanth
​i need to convert r data fr​ame to pandas dataframe and vise versa -- *Regards* *Sushanth* *ph : 91-9444583307* -- https://mail.python.org/mailman/listinfo/python-list