pythonslearning can be directly access using https://pythonslearning.com . This website shows all the data results related to python data science and machine learning. And for practice purposes exercise and solution tutorials also available. Happy learning
PYTHON • DATA SCIENCE • AI
Master Python, Data Science & Machine Learning
#Python
#Pandas
#NumPy
#MachineLearning
#Projects
Showing posts with label data science. Show all posts
Showing posts with label data science. Show all posts
Friday, May 15, 2020
Tuesday, May 12, 2020
Pandas Built in Data Visualization pandas to excel Tutorial
Pandas Built in Data Visualization Tutorial:
Want to learn Pandas Built in Data Visualization?
Welcome to my python crash course blog post.In the previous blog we see Data Visualization with Matplotlib and seaborn,In this lecture we will learn about pandas built-in capabilities for data visualization! In the next blog we will see what is pandas to excel ? It's built-off of matplotlib,
Welcome to my python crash course blog post.In the previous blog we see Data Visualization with Matplotlib and seaborn,In this lecture we will learn about pandas built-in capabilities for data visualization! In the next blog we will see what is pandas to excel ? It's built-off of matplotlib,
but it baked into pandas for easier usage!
Let's take a look!
import numpy as np
import pandas as pd
%matplotlib inline
There are some fake data csv files you can read in as dataframes:
Style Sheets
Matplotlib has style sheets you can use to make your plots look a little nicer. These style sheets include plot_bmh,plot_fivethirtyeight,plot_ggplot and more. They basically create a set of style rules that your plot follow. I recommend using them, they make all your plots have the same look and feel more professional. You can even create your own if you want your company's plots to all have the same look (it is a bit tedious to create on though).
Here is how to use them
Plot Types
There are several plots types built-in to pandas, most of them statistical plot in nature:
- df.plot.area
- df.plot.barh
- df.plot.density
- df.plot.hist
- df.plot.line
- df.plot.scatter
- df.plot.bar
- df.plot.box
- df.plot.hexbin
- df.plot.kde
- df.plot.pie
Sunday, May 10, 2020
seaborn for data visualization tutorial
SEABORN FOR DATA VISUALIZATION TUTORIAL part_02:
Want to learn Seaborn for Data Visualization part02 Tutorial?
Hello everyone, today I have write a post related to Seaborn for Data Visualization. this is second part of this blog post. if you want to see first part then please see my blog post. so Let's start friends:
Hello everyone, today I have write a post related to Seaborn for Data Visualization. this is second part of this blog post. if you want to see first part then please see my blog post. so Let's start friends:
In this blog post I have covered the Grid, Regression plos, markers and size aspect Ratio.
(NOTE THIS: For detailed please open drive link)
Grid
Grid are general types of plots that allow you to map plot types to rows and columns of a grid, this helps you create similar plots separated by features.
PairGrids
Pairgrids is a subplot grid for plotting pairwise relationships in a dataset.
pairplots
pairplots is a simpler version of PairGrid (you'll use quite often)
Facet Grids
FacetGrids is the general way to create grids of plots based off of a feature:
JointGrids
JointGrids is the general version for jointplot() type grids, for a quick example:
Regression Plot
Seaborn has many built-in capabilities for regression plots, however we won't really discuss regression until the machine learning section of the course, so we will only cover the lmplot() function for now.
lmplot allows you to display linear model, but it also conveniently allow you to split up those plots based off of features, as well as coloring the hue based off of feature.
Let's explore how this works:
Working with Markers
lmplot kwargs get passed through to **regplot** which is a more general form of lmplot(). regplots has a scatter_kws parameter that get passed to plt.scatter. So you want to set the parameter in that dictionary, which corresponds (a bit confusingly) to the squared markersize. In other words you end up passing a dictionary with the base matplotlib arguments, in this case, s for size of a scatter plot. In general, you probably won not remember this off the top of your head, but instead reference the documentation.
You can use matplotlib's *plt.figure(figsize=(width,height) * to change the size of most seaborn plots.
You can control the size and aspect ratios of most seaborn grid plots by passing in parameters: size, and aspect. For example:

Example
import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
df = sb.load_dataset('iris')
sb.distplot(df['petal_length'],kde = False)
plt.show()
Output

Example
import pandas as pd
import seaborn as sb
from matplotlib import pyplot as plt
df = sb.load_dataset('iris')
sb.stripplot(x = "species", y = "petal-length", data = df)
plt.show()
Output

Tags: seaborn for data visualization tutorial
FOR DETAILED PLEASE OPEN BELOW LINK:
OPEN HERE OR https://drive.google.com/open?id=1s-7zfmmGxjbev-eviRcVgC2PV4QbqoLM
(Note: If you like blog post then please comment and share)
(Note: If you like blog post then please comment and share)
Saturday, May 9, 2020
Seaborn Library in python for Data Visualization Tutorial
Seaborn for Data Visualization:
Want learn Seaborn Library in python for Data Visualization Tutorial?
Hello everyone, I'm already post the blog of Data Visualization for Matplotlib so it's time to see second part of the post Data Visualization with Seaborn liabrary. Let's start toward the seaborn.
Hello everyone, I'm already post the blog of Data Visualization for Matplotlib so it's time to see second part of the post Data Visualization with Seaborn liabrary. Let's start toward the seaborn.
There the different plot are used in Saborn, we have to see some plot in this blog:
Distribution Plots
Let's discuss some plots that allow us to visualize the distribution of a data set. These plots are:
- distplot
- jointplot
- pairplot
- rugplot
- kdeplot
Thursday, May 7, 2020
Matplotlib for Data Visualization python
Matplotlib for Data Visualization python
Introduction
Want to learn Data Visualization using Matplotlib?Hello friends, in the previous blog post we have to see basic pandas library Numpy and pandas so it's time to see Data viasualization in python using Matplotlib. so first upon what is matplotlib ? let's start. Matplotlib is the grandfathers library of data visualizations with Python. It was created by the John Hunter. He created it to try to replicate MatLab(another programming language) plotting capabilities in Pythons. So if you happen to be familiar with matlab, matplotlibs will feel natural to you.
It is an excellent 2D and 3D graphic library for generating scientific figures.
![]() |
| fig 01)Matplotlib for Data Visualization python |
Some of the major Pros of Matplotlibs are:
- Generally easy to started for simple plot
- Support for custom labels and text
- Great control of every element in a figures
- High-quality output in many formats
- Very customizable in general
Matplotlib allows you to create reproducible figures programmatically. Let's learn how to use it! Before continuing this lecture, I encourage you just to explore the official Matplotlib web page: http://matplotlib.org/
Installation
You'll need to install matplotlib first with either:
conda install matplotlib
or pip install matplotlib
Wednesday, May 6, 2020
pandas in python tutorials-beginners
pandas in python tutorials:
In this section of the blog we will learn how to use pandas for data analysis. You can think of pandas as an extremely powerful version of Excels, with a lot more features. In this section of the course, you should go through the notebooks in this order for this please ope below drive link:
what is pandas in python ?
In computer programming language, pandas is a library written for the Python language for data manipulation and analysis the data.It's also performed the data structures and operation for manipulating numerical table and times series data.
Some Latest important update about pandas :
What’s new in 1.0.5 (June 17, 2020)
Some Latest important update about pandas :
What’s new in 1.0.5 (June 17, 2020)
How to install pandas in python ?
WE USE THIS FOLLOWING COMMAND LINE FOR INSTALL PANDAS
pip install pandas !
How to import pandas in python ?
WE USE THIS FOLLOWING COMMAND LINE FOR import PANDAS
import pandas as pd !
- Introduction to Pandas
- Series
- DataFrames
- Missing Data
- GroupBy
- Merging,Joining,and Concatenating
- Operations
- Data Input and Output
SOME EXAMPLE ON PANDAS:
3.1 example:
Let us now create an indexed DataFrame using array.
import pandas as pd
data = {'Name':['sachin', 'pagar', 'sunil', 'Rahul'],'Age':[28,34,29,42]}
df = pd.DataFrame(data, index=['rank1','rank2','rank3','rank4'])
print df
Its output is as follows −
Age Name
rank1 28 sachin
rank2 34 pagar
rank4 42 Rahul
rank3 29 Sunil
Let us now create an indexed DataFrame using array.
import pandas as pddata = {'Name':['sachin', 'pagar', 'sunil', 'Rahul'],'Age':[28,34,29,42]}df = pd.DataFrame(data, index=['rank1','rank2','rank3','rank4'])print df
Its output is as follows −
Age Namerank1 28 sachinrank2 34 pagarrank4 42 Rahulrank3 29 Sunil
what is numpy in python with example-tutorial
what is numpy in python ?
Please note, this is not meant to be a comprehensive overview of Python or programming in general, if you have no programming experience, don't worry simply read by blog post.
what is numpy in python ?
Numpy in python is a Linear Algebra Library for Python, the reason it is so importants for Data Science with Python is that almost all of the libraries in the PyData Ecosystem rely on NumPy as one of their main building block.(i.e. pandas,data visualization, seaborn etc.)
Numpy is incredibly fast, as it has bindings to C libraries. For more info on why you would want to use Arrays instead of list.
Numpy is basically array processing package. It's provide very high performance multidimensional array.
We will only learn the basic of NumPy, to get started we need to install it!
HOW TO INSTALL NUMPY IN PYTHON :
It is highly recommended you install Python using the Anaconda distributions to make sure all underlying Dependencies (such as Linear Algebra libraries) all sync up with the use of a conda install. If you have Anaconda, install Numpy by going to your terminals or command prompt and typing:
1] conda install numpy.
If you do not have Anaconda and can't install it, please refer to Numpy's official documentation on various installation instructions.
SOME BASIC EXAMPLES:
1.1 Example
import numpy as npa = np.array([1,2,3,4,5,6,7])np.savetxt('out.txt',a)b = np.loadtxt('out.txt')print b
It will produce the following outputs −
[ 1. 2. 3. 4. 5. 6. 7.]
Subscribe to:
Posts (Atom)
JSON Module in Python: Parsing and Writing JSON Data
The json module in Python allows you to encode and decode JSON (JavaScript Object Notation) data. It provides built-in methods for convertin...
-
python read from stdin : Welcome to python tutorials point, In this post we are see in detailed How to python read from stdin. Before ...
-
Logistic Regression : Welcome everyone, this is first post of LOGISTIC REGRESSION . In the previous post we see Linear regression. ...
-
python tutorials point : Introduction : Welcome everyone in our community python tutorials point . This post is related to soft overvi...





