The Big Data Landscape Diagram 2016 – Version


In this quick notes, we will have a look at Rank and Sort in Series and DataFrames in Python In [1]:
|
1 2 3 |
import numpy as np import pandas as pd from pandas import Series, DataFrame |
In [3]:
|
1 2 3 |
#make a series ser1 = Series(range(3), index=['C','A','B']) ser1 |
Out[3]:
|
1 2 3 4 |
C 0 A 1 B 2 dtype: int32 |
In [4]:
|
1 2 |
#sort index of series ser1.sort_index() |
Out[4]:
|
1 2 3 4 |
A 1 B 2 C 0 dtype: int32 |
In [5]:
|
1 2 |
#order or sort by values ser1.order() |
|
1 2 |
C:\Users\adaba\Anaconda3\lib\site-packages\ipykernel\__main__.py:2: FutureWarning: order is deprecated, use sort_values(...) from ipykernel import kernelapp as app |
Out[5]:
|
1 2 3 4 |
C 0 A 1 B 2 dtype: int32 |
In [6]:
|
1 |
ser1.sort_values() |
Out[6]:
|
1 2 3 4 |
C 0 A 1 B 2 dtype: int32 |
In [7]:
|
1 |
from numpy.random import randn |
In [8]:
|
1 2 3 |
#make a series by passing in 10 random numbers ser2 = Series(randn(10)) ser2 |
Out[8]:
|
1 2 3 4 5 6 7 8 9 10 11 |
0 -0.201751 1 1.534109 2 0.542825 3 1.421174 4 -0.173771 5 0.002573 6 -0.490208 7 -0.765340 8 -2.546040 9 -0.456699 dtype: float64 |
In [10]:
|
1 2 |
#sort the values ser2.sort_values() |
…
What is population size: In simple terms, let’s us say population is the WHOLE SET and What is sample size: let us say it is the SUBSET (which is within the whole set) The norm Normally subsets are within the whole set and are smaller than the whole set Can they be equal ? Yes…
Want more information like this? Email People Who Read The Above Post Also Read This: How To Power On The Python Idle – Python How To Track The Effectiveness of Email Campaign – Some Points to Consider
I know this can be very simple and straightforward for most people, but hey, when i was beginning to program in Python, I did not know how to get the Python Idle running. Hence l cover that quickly here. It is assumed you have already downloaded and installed Python on your windows PC You can…
DataPandas wishes you Happy International Workers’ Day! Want more information like this? Email People Who Read The Above Post Also Read This: Happy Weekend To You All
Happy Weekend To You All From The DataPandas Team 🙂 Want more information like this? Email People Who Read The Above Post Also Read This: How To Power On The Python Idle – Python How To Track The Effectiveness of Email Campaign – Some Points to Consider Sending Email Using Python Smtplib Automate Email Sending…
An experienced DevOps and Cloud Training Company to meet your DevOps and Cloud needs
You can see how this popup was set up in our step-by-step guide: https://wppopupmaker.com/guides/auto-opening-announcement-popups/
On this website we use first or third-party tools that store small files (cookie) on your device. Cookies are normally used to allow the site to run properly (technical cookies), to generate navigation usage reports (statistics cookies) and to suitable advertise our services/products (profiling cookies). We can directly use technical cookies, but you have the right to choose whether or not to enable statistical and profiling cookies. Enabling these cookies, you help us to offer you a better experience.