How to create my own csv in Machine learning | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

8th Aug 2020, 5:56 PM
🔥 Destiny Travolta 🔥
19 Answers
+ 8
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
8th Aug 2020, 6:07 PM
JME
+ 7
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
8th Aug 2020, 6:22 PM
Namit Jain
Namit Jain - avatar
+ 6
Namit Jain Wow thanks for that I just ignored my data science course 😓😓
8th Aug 2020, 6:24 PM
🔥 Destiny Travolta 🔥
+ 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!
8th Aug 2020, 6:12 PM
Namit Jain
Namit Jain - avatar
+ 5
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😊
8th Aug 2020, 6:14 PM
TEMPER.xi
TEMPER.xi - avatar
+ 5
Dani Thanks a ton bro 😀😀😊😊😄😄😄
8th Aug 2020, 6:22 PM
🔥 Destiny Travolta 🔥
+ 5
Dani Thanks guys for all your answers 😎😎😎😘😘😀😀😀
8th Aug 2020, 6:25 PM
🔥 Destiny Travolta 🔥
+ 4
Csv is comma separated value. You can create csv file using excel. Open excel type your data and while saving it choose .csv extension.
9th Aug 2020, 8:05 AM
Akash Subhash Mali
Akash Subhash Mali - avatar
+ 3
Dani Isn't matplotlib another library? 😐😐
8th Aug 2020, 6:19 PM
🔥 Destiny Travolta 🔥
+ 3
Akash Subhash Mali Yess!!! Excel is a very good option!
9th Aug 2020, 8:06 AM
Namit Jain
Namit Jain - avatar
+ 2
Dani Pls explain further
8th Aug 2020, 6:07 PM
🔥 Destiny Travolta 🔥
+ 2
JME Pls can u make a code like that and post it?
8th Aug 2020, 6:09 PM
🔥 Destiny Travolta 🔥
+ 2
Yes u can use it to plot almost anything in the pandas library😊
8th Aug 2020, 6:22 PM
TEMPER.xi
TEMPER.xi - avatar
+ 2
It is is true have a valid understanding of data science
8th Aug 2020, 6:24 PM
TEMPER.xi
TEMPER.xi - avatar
+ 2
Akash Subhash Mali That sounds like a good plan
9th Aug 2020, 10:41 AM
🔥 Destiny Travolta 🔥
+ 2
Logomonic Learning Thanks for the advice 😊😊
10th Aug 2020, 6:59 AM
🔥 Destiny Travolta 🔥
+ 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)
10th Aug 2020, 11:40 AM
Sreeraj V A
Sreeraj V A - avatar
+ 1
Destiny use iris
8th Aug 2020, 6:07 PM
TEMPER.xi
TEMPER.xi - avatar
+ 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
10th Aug 2020, 6:58 AM
Logomonic Learning
Logomonic Learning - avatar