Академический Документы
Профессиональный Документы
Культура Документы
Machine Learning is a valuable skill to learn. There's no doubt about it. But let's face it, most of the time, we can already
generate a business value with relatively simple calculations, we just have to ask the right questions (Credits to a meme
that i saw from Isaac Reyes). But sometimes, when faced with ~100mb worth of data, excel isn't gonna cut it. Most Data
Analysts comes from a quantitative degree, without a Programming background, and most introductory tutorial isn't
practical. My goal is to let you get started in using Python for Data Analysis. We will cover:
Once you have your Jupyter up and running, it will look something like this:
To upload your csv file, simply click on the Upload button (On the right hand corner). Once you have uploaded your csv
file, you're ready to create your first notebook file. Simply click on New which is right beside the Upload button.
In [1]: import pandas as pd #You have to write this code first. Just think of this a
s a requirement.
#The below to code are just to give you an excel like feel.
pd.set_option('display.max_columns', False)
What the code below is doing is it is loading your csv file named mydata.csv to a variable named dataset .
The command :
dataset.head(5)
will show the first 5 rows of your data. Changing the number inside will change the number of rows displayed.
20/11/2019, 1:44 pm
In [2]: dataset = pd.read_csv('mydata.csv')
pd.set_option('display.max_rows', dataset.shape[0]+1)
dataset.head(5)
Out[2]:
Product_Info_1 Product_Info_2 Product_Info_3 Product_Info_4 Product_Info_5 Ins_Age Ht
In [3]: dataset[dataset['Ht']>0.8].head(10)
Out[3]:
Product_Info_1 Product_Info_2 Product_Info_3 Product_Info_4 Product_Info_5 Ins_Age Ht
20/11/2019, 1:44 pm
In [4]: dataset[(dataset['Ht']>0.8) & (dataset['Wt']<0.6)].head(10)
Out[4]:
Product_Info_1 Product_Info_2 Product_Info_3 Product_Info_4 Product_Info_5 Ins_Age Ht
Out[5]:
Product_Info_1 Product_Info_2 Product_Info_3 Product_Info_4 Product_Info_5 Ins_Age Ht
To be continued..
In [ ]:
20/11/2019, 1:44 pm