Re: issue in handling CSV data

2019-09-10 Thread Piet van Oostrum
Sharan Basappa writes: >> >> Note that the commas are within the quotes. I'd say Andrea is correct: >> This is a tab-separated file, not a comma-separated file. But for some >> reason all fields except the last end with a comma. >> However, genfromtxt is not a full-fledged CSV parser. It does

Re: issue in handling CSV data

2019-09-10 Thread Gregory Ewing
Sharan Basappa wrote: Now, if you see the print after getting the data, it looks like this: ## [['"\t"81' '"\t5c'] ['"\t"04' '"\t11'] ['"\t"e1' '"\t17'] ['"\t"6a' '"\t6c'] ['"\t"53' '"\t69'] ['"\t"98' '"\t87'] ['"\t"5c' '"\t4b']

Re: issue in handling CSV data

2019-09-09 Thread Sharan Basappa
On Sunday, 8 September 2019 12:45:45 UTC-4, Peter J. Holzer wrote: > On 2019-09-08 05:41:07 -0700, Sharan Basappa wrote: > > On Sunday, 8 September 2019 04:56:29 UTC-4, Andrea D'Amore wrote: > > > On Sun, 8 Sep 2019 at 02:19, Sharan Basappa > > > wrote: > > > > As you can see, the string

Re: issue in handling CSV data

2019-09-08 Thread Peter J. Holzer
On 2019-09-08 05:41:07 -0700, Sharan Basappa wrote: > On Sunday, 8 September 2019 04:56:29 UTC-4, Andrea D'Amore wrote: > > On Sun, 8 Sep 2019 at 02:19, Sharan Basappa > > wrote: > > > As you can see, the string "\t"81 is causing the error. > > > It seems to be due to char "\t". > > > > It is

Re: issue in handling CSV data

2019-09-08 Thread Sharan Basappa
On Sunday, 8 September 2019 04:56:29 UTC-4, Andrea D'Amore wrote: > On Sun, 8 Sep 2019 at 02:19, Sharan Basappa wrote: > This is the error: > > my_data_3 = my_data_2.astype(np.float) > > could not convert string to float: " "81 > > > As you can see, the string "\t"81 is causing the error. > >

Re: issue in handling CSV data

2019-09-08 Thread Andrea D'Amore
On Sun, 8 Sep 2019 at 02:19, Sharan Basappa wrote: This is the error: > my_data_3 = my_data_2.astype(np.float) > could not convert string to float: " "81 > As you can see, the string "\t"81 is causing the error. > It seems to be due to char "\t". It is not clear what format do you expect to be

Re: issue in handling CSV data

2019-09-07 Thread Sharan Basappa
On Saturday, 7 September 2019 21:18:11 UTC-4, MRAB wrote: > On 2019-09-08 01:19, Sharan Basappa wrote: > > I am trying to read a log file that is in CSV format. > > > > The code snippet is below: > > > > ### > > import matplotlib.pyplot as plt > > import seaborn as

Re: issue in handling CSV data

2019-09-07 Thread MRAB
On 2019-09-08 01:19, Sharan Basappa wrote: I am trying to read a log file that is in CSV format. The code snippet is below: ### import matplotlib.pyplot as plt import seaborn as sns; sns.set() import numpy as np import pandas as pd import os import csv from numpy

Re: issue in handling CSV data

2019-09-07 Thread Joel Goldstick
On Sat, Sep 7, 2019 at 8:28 PM Joel Goldstick wrote: > > On Sat, Sep 7, 2019 at 8:21 PM Sharan Basappa > wrote: > > > > I am trying to read a log file that is in CSV format. > > > > The code snippet is below: > > > > ### > > import matplotlib.pyplot as plt > > import

Re: issue in handling CSV data

2019-09-07 Thread Joel Goldstick
On Sat, Sep 7, 2019 at 8:21 PM Sharan Basappa wrote: > > I am trying to read a log file that is in CSV format. > > The code snippet is below: > > ### > import matplotlib.pyplot as plt > import seaborn as sns; sns.set() > import numpy as np > import pandas as pd >

issue in handling CSV data

2019-09-07 Thread Sharan Basappa
I am trying to read a log file that is in CSV format. The code snippet is below: ### import matplotlib.pyplot as plt import seaborn as sns; sns.set() import numpy as np import pandas as pd import os import csv from numpy import genfromtxt # read the CSV and get into