#how to run this?

27 messages · Page 1 of 1 (latest)

deft panther
#

How to run csv in python to read columns?

#

how to run this?

vapid wasp
#

There are lots of ways depending on what you want to do with the csv

#

If you just want to read columns then you can use the inbuilt csv module

quick parcel
#

just split each line by comma's?

vapid wasp
#

That works too

#

But using csv is easier in my opinion

#

(or pandas for more advanced manipulations)

deft panther
#

In pandas I'm doing it

#

But it's not working though

vapid wasp
#

Maybe you should provide some more information then

deft panther
#

here you go

vapid wasp
#

Did you preview your data in pandas first?

#

You should always preview to make sure you read the data in correctly, and to gain some initial information that will guide the process

deft panther
#

can you tell me how to do it because i m new to this

vapid wasp
#

data.head() is a good start

#

It gives you the first 5 rows of your data set

#

data.shape tells you how many rows and columns you have

#

data.columns gives you the column names of the data

#

data.info() gives you lots of information about the values in your data

#

Those are some that I always do whenever I do a data science project

deft panther
#

ok so after this i must go with read column?

vapid wasp
#

You must? Read column?

#

What do you mean by your question?

deft panther
#

i m sorry, after data preview i should go with csv read column isn't? will it work?

#

Anyways Thank you

vapid wasp
#

It depends on what you're trying to do and how you're trying to achieve your goals