Python Programming and Data Analysis
Python Programming and Data Analysis
• It is a distribution, which you need to install in your computer to run python packages
• Alternatively you can use pip to install your libraries and dependencies
JUPYTER NOTEBOOK
• Python3
• Anaconda
• pip for Python3
INSTALLATION AND OPENING A NOTEBOOK
1. Open a Terminal/Powershell/Command Prompt
2. Type the following “pip install notebook”
3. Then Type “jupyter notebook” to run the notebook
4. Once its running copy the link into a browser which shows on your terminal which should be in the
position of the red underlined in the figure below
CREATING A PYTHON FILE
• Once its opened in the browser, Click on New -> Python 3 (ipykernel) as shown in the image to open a
python notebook
TYPES OF CELL
• Just like C, you can import python libraries into Jupyter notebook
• Here are a few libraries you require to make your coursework run:
• Pandas
• NumPy
• Matplotlib
READING A FILE
SHORTENING THE DATAFRAME
• Two ways
• Slice by Rows
• df1 = dataframe.iloc[0:9]
• Where 0 is the position where you want to start slicing and 9 is the position where you want to stop.
• Slice by Columns
• df1 = dataframe.iloc[0:9, 0:3]
• Where the first values before the comma is slicing the rows and the values after the comma is slicing the columns
TYPES OF CHARTS
• Line Graphs
• Bar Charts
• Pie Charts
• Histogram
• Scatter plot
• Venn Chart
• Area Charts
• Spline Chart
• Box and Whisker Chart
• Radar Chart
LINE GRAPHS
• The Spline Chart is one of the most widespread types of graphs and charts
used in statistics.
• Uses:
• Product lifecycle chart
• Designing Pareto charts
• Spline chart also is often used for data modeling
BOX AND WHISKER CHART