How to create my own csv in Machine learning | SoloLearn: Learn to code for FREE!

+5

How to create my own csv in Machine learning

I was taught csv in machine learning but we weren't told how to make our personal csv. I want to make my own so does anyone have any ideas

8/8/2020 5:56:43 PM

🔥 Destiny Travolta 🔥

20 Answers

New Answer

+7

Csv just means comma separated value. You can open up a .txt file and type in your data. Columns are separated by commas and rows are separated by new lines. Then save as .csv

+6

Destiny yess!! It's another library! Dani is just giving you ideas! You will learn about it when you will continue your data science course! And I advise you: Don't get started with ml course without completing half of the data science course

+6

Namit Jain Wow thanks for that I just ignored my data science course 😓😓

+5

Any txt file (notepad) will work! Ok, if the data is not comma separated i.e. it is separated by something else let it be ";" So no need of doing something very long Just take it as: a = pd.read_csv("filename.txt", sep=";") And this will solve your problem! I am telling you this because many times datasets of internet are of another form!

+5

Dani Thanks a ton bro 😀😀😊😊😄😄😄

+5

Dani Thanks guys for all your answers 😎😎😎😘😘😀😀😀

+4

import pandas as pd iris = pd.csv('iris.csv') print (iris.head ()) This code is part of python when it comes to data manipulation so u can also plot iris with matplotlib. Hope it helps😊

+3

Dani Isn't matplotlib another library? 😐😐

+3

Csv is comma separated value. You can create csv file using excel. Open excel type your data and while saving it choose .csv extension.

+3

Akash Subhash Mali Yess!!! Excel is a very good option!

+2

Dani Pls explain further

+2

JME Pls can u make a code like that and post it?

+2

Yes u can use it to plot almost anything in the pandas library😊

+2

It is is true have a valid understanding of data science

+2

Akash Subhash Mali That sounds like a good plan

+2

Logomonic Learning Thanks for the advice 😊😊

+2

Create a dictionary with column names as keys and list of values as value. Example import pandas as pd dict1 = {'company':['A','B','C','A','C','D'], 'mngr':['x', 'y', 'z', 'x', 'p', 'q'], 'amt':[100,200,100,150,300,225]} df = pd.DataFrame(dict1)

+1

Destiny use iris

+1

An easier way to create csv is wit a spreadsheet like excel or open office(free), you can even use google docs. Just remember to save with file extension .csv