+ 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
19 Respuestas
+ 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
+ 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
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😊
+ 5
Dani
Thanks a ton bro
😀😀😊😊😄😄😄
+ 5
Dani
Thanks guys for all your answers
😎😎😎😘😘😀😀😀
+ 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.
+ 3
Dani
Isn't matplotlib another library?
😐😐
+ 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