SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
1 www.quandl.com
NumPy / SciPy / Pandas Cheat Sheet
Select column.
Select row by label.
Return DataFrame index.
Delete given row or column. Pass axis=1 for columns.
Reindex df1 with index of df2.
Reset index, putting old index in column named index.
Change DataFrame index, new indecies set to NaN.
Show first n rows.
Show last n rows.
Sort index.
Sort columns.
Pivot DataFrame, using new conditions.
Transpose DataFrame.
Change lowest level of column labels into innermost row index.
Change innermost row index into lowest level of column labels.
NumPy / SciPy
arr = array([])
arr.shape
convolve(a,b)
arr.reshape()
sum(arr)
mean(arr)
std(arr)
dot(arr1,arr2)
vectorize()
Create a Series.
Create a Dataframe.
Create a Panel.
Pandas
Create Structures
s = Series (data, index)
df = DataFrame (data, index, columns)
p = Panel (data, items, major_axis, minor_axis)
df.stack()
df.unstack()
df.pivot(index,column,values)
df.T
DataFrame commands
df[col]
df.iloc[label]
df.index
df.drop()
df1 = df1.reindex_like(df1,df2)
df.reset_index()
df.reindex()
df.head(n)
df.tail(n)
df.sort()
df.sort(axis=1)
Create numpy array.
Shape of an array.
Linear convolution of two sequences.
Reshape array.
Sum all elements of array.
Compute mean of array.
Compute standard deviation of array.
Compute inner product of two arrays.
Turn a scalar function into one which
accepts & returns vectors.
2 www.quandl.com
Create a time series index.date_range(start, end, freq)
Pandas Time Series
Business Day
Calender day
Weekly
Monthly
Quarterly
Annual
Hourly
B
D
W
M
Q
A
H
Freq has many options including:
Any Structure with a datetime index
Split DataFrame by columns. Creates a GroupBy object (gb).
Apply function (single or list) to a GroupBy object.
Applies function and returns object with same index as one
being grouped.
Filter GroupBy object by a given function.
Return dict whose keys are the unique groups, and values
are axis labels belonging to each group.
Groupby
groupby()
gb.agg()
gb.transform()
gb.filter()
gb.groups
Save to CSV.
Read CSV into DataFrame.
Save to Excel.
Read exel into DataFrame.
I/O
df.to_csv(‘foo.csv’)
read_csv(‘foo.csv’)
to_excel(‘foo.xlsx’, sheet_name)
read_excel(‘foo.xlsx’,’sheet1’, index_col =
None, na_values = [‘NA’])
df.dropna()
df.count()
df.min()
df.max()
df.describe()
concat()
Drops rows where any data is missing.
Returns Series of row counts for every column.
Return minimum of every column.
Return maximum of every column.
Generate various summary statistics for every column.
Merge DataFrame or Series objects.
Apply function to every element in DataFrame.
Apply function along a given axis.
df.applymap()
df.apply()
Resample data with new frequency.ts.resample()
3 www.quandl.com
Select current axis.
Change axis color, none to remove.
Change axis position. Can change coordinate space.
Create legend. Set to ‘best’ for auto placement.
Save plot.
ax=gca()
ax.spines[].set_color()
ax.spines[].set_position()
Label the x-axis.
Label the y-axis.
Title the graph.
Set tick values for x-axis. First array for values, second
for labels.
Set tick values for y-axis. First array for values, second
for labels.
yticks([],[])
Plot data or plot a function against a range.
Create multiple plots; n- number of plots, x - number
horizontally displayed, y- number vertically displayed.
plot()
subplot(n,x,y)
xlabel()
ylabel()
title()	
xticks([],[])
Plotting
Matplotlib is an extremely powerful module.
See www.matplotlib.org for complete documentation.
Quandl is a search engine for numerical data, allowing
easy access to financial, social, and demographic data
from hundreds of sources.
Quandl
The Quandl package enables Quandl API access from
within Python, which makes acquiring and manipulating
numerical data as quick and easy as possible.
In your first Quandl function call you should specifiy your
authtoken (found on Quandl’s website after signing up) to
avoid certain API call limits.
See www.quandl.com/help/packages/python for more.
savefig(‘foo.png’)
legend(loc=’ ‘)
Return data for nearest time interval.
Return data for specific time.
Return data between specific interval.
Convert Pandas DatetimeIndex to datetime.datetime object.
Conver a list of date-like objects (strings, epochs, etc.) to a
DatetimeIndex.
ts.ix[start:end]
ts[]
ts.between_time()
to_pydatetime()
to_datetime()
4 www.quandl.com
Plotting Example
import Quandl as q
import matplotlib.pyplot as plt
rural = q.get(‘WORLDBANK/USA_SP_RUR_TOTL_ZS’)
urban = q.get(‘WORLDBANK/USA_SP_URB_TOTL_IN_ZS’)
plt.subplot(2, 1, 1)				
plt.plot(rural.index,rural)					
	
plt.xticks(rural.index[0::3],[])					
	
plt.title(‘American Population’)					
	
plt.ylabel(‘% Rural’)				
plt.subplot(2, 1, 2)				
plt.plot(urban.index,urban)					
	
plt.xlabel(‘year’)						
plt.ylabel(‘% Urban’)				
plt.show()
Add the following to any function call.
Download Quandl data for a certain Quandl code
as a Dataframe.
Search Quandl. Outputs first 4 results.
Upload a Pandas DataFrame (with a time series index) to
Quandl. Code must be all capital alphanumeric.
authtoken = ‘YOURTOKENHERE’
get(‘QUANDL/CODE’)
search(‘searchterm’)
push(data, code, name)

Weitere ähnliche Inhalte

Was ist angesagt?

C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : ArraysGagan Deep
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandasPiyush rai
 
Data Wrangling with dplyr and tidyr Cheat Sheet
Data Wrangling with dplyr and tidyr Cheat SheetData Wrangling with dplyr and tidyr Cheat Sheet
Data Wrangling with dplyr and tidyr Cheat SheetDr. Volkan OBAN
 
Python seaborn cheat_sheet
Python seaborn cheat_sheetPython seaborn cheat_sheet
Python seaborn cheat_sheetNishant Upadhyay
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional arrayRajendran
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array pptsandhya yadav
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesAndrew Ferlitsch
 
Python For Data Science Cheat Sheet
Python For Data Science Cheat SheetPython For Data Science Cheat Sheet
Python For Data Science Cheat SheetKarlijn Willems
 
Array in c language
Array in c languageArray in c language
Array in c languagehome
 
Programming in c arrays
Programming in c   arraysProgramming in c   arrays
Programming in c arraysUma mohan
 

Was ist angesagt? (20)

C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : Arrays
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandas
 
Data Wrangling with dplyr and tidyr Cheat Sheet
Data Wrangling with dplyr and tidyr Cheat SheetData Wrangling with dplyr and tidyr Cheat Sheet
Data Wrangling with dplyr and tidyr Cheat Sheet
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
Arrays
ArraysArrays
Arrays
 
Python seaborn cheat_sheet
Python seaborn cheat_sheetPython seaborn cheat_sheet
Python seaborn cheat_sheet
 
C programming , array 2020
C programming , array 2020C programming , array 2020
C programming , array 2020
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Programming in c Arrays
Programming in c ArraysProgramming in c Arrays
Programming in c Arrays
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
C arrays
C arraysC arrays
C arrays
 
Introduction to Array ppt
Introduction to Array pptIntroduction to Array ppt
Introduction to Array ppt
 
C++ lecture 04
C++ lecture 04C++ lecture 04
C++ lecture 04
 
Array in c++
Array in c++Array in c++
Array in c++
 
Data transformation-cheatsheet
Data transformation-cheatsheetData transformation-cheatsheet
Data transformation-cheatsheet
 
Python - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning LibrariesPython - Numpy/Pandas/Matplot Machine Learning Libraries
Python - Numpy/Pandas/Matplot Machine Learning Libraries
 
Python For Data Science Cheat Sheet
Python For Data Science Cheat SheetPython For Data Science Cheat Sheet
Python For Data Science Cheat Sheet
 
Array in c language
Array in c languageArray in c language
Array in c language
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Programming in c arrays
Programming in c   arraysProgramming in c   arrays
Programming in c arrays
 

Andere mochten auch

Ccna cheat sheet
Ccna cheat sheetCcna cheat sheet
Ccna cheat sheetaromal4frnz
 
Customer journey maps: the Why and the What
Customer journey maps: the Why and the WhatCustomer journey maps: the Why and the What
Customer journey maps: the Why and the WhatSmaply
 
Thorax and Abdomen CT Cheat Sheet
Thorax and Abdomen CT Cheat SheetThorax and Abdomen CT Cheat Sheet
Thorax and Abdomen CT Cheat SheetChase Allen
 
Effective 15-minute presentations - Cheat Sheet
Effective 15-minute presentations - Cheat SheetEffective 15-minute presentations - Cheat Sheet
Effective 15-minute presentations - Cheat SheetJan Schrage
 
How to evaluate a customer journey map?
How to evaluate a customer journey map?How to evaluate a customer journey map?
How to evaluate a customer journey map?Smaply
 
Ultimate Accounting "Cheat Sheet"
Ultimate Accounting "Cheat Sheet"Ultimate Accounting "Cheat Sheet"
Ultimate Accounting "Cheat Sheet"Joe Jancsics
 

Andere mochten auch (7)

Seo cheat-sheet
Seo cheat-sheetSeo cheat-sheet
Seo cheat-sheet
 
Ccna cheat sheet
Ccna cheat sheetCcna cheat sheet
Ccna cheat sheet
 
Customer journey maps: the Why and the What
Customer journey maps: the Why and the WhatCustomer journey maps: the Why and the What
Customer journey maps: the Why and the What
 
Thorax and Abdomen CT Cheat Sheet
Thorax and Abdomen CT Cheat SheetThorax and Abdomen CT Cheat Sheet
Thorax and Abdomen CT Cheat Sheet
 
Effective 15-minute presentations - Cheat Sheet
Effective 15-minute presentations - Cheat SheetEffective 15-minute presentations - Cheat Sheet
Effective 15-minute presentations - Cheat Sheet
 
How to evaluate a customer journey map?
How to evaluate a customer journey map?How to evaluate a customer journey map?
How to evaluate a customer journey map?
 
Ultimate Accounting "Cheat Sheet"
Ultimate Accounting "Cheat Sheet"Ultimate Accounting "Cheat Sheet"
Ultimate Accounting "Cheat Sheet"
 

Ähnlich wie Pandas,scipy,numpy cheatsheet

Pandas cheat sheet_data science
Pandas cheat sheet_data sciencePandas cheat sheet_data science
Pandas cheat sheet_data scienceSubrata Shaw
 
Data Wrangling with Pandas
Data Wrangling with PandasData Wrangling with Pandas
Data Wrangling with PandasLuis Carrasco
 
R Programming Reference Card
R Programming Reference CardR Programming Reference Card
R Programming Reference CardMaurice Dawson
 
Broom: Converting Statistical Models to Tidy Data Frames
Broom: Converting Statistical Models to Tidy Data FramesBroom: Converting Statistical Models to Tidy Data Frames
Broom: Converting Statistical Models to Tidy Data FramesWork-Bench
 
R command cheatsheet.pdf
R command cheatsheet.pdfR command cheatsheet.pdf
R command cheatsheet.pdfNgcnh947953
 
Short Reference Card for R users.
Short Reference Card for R users.Short Reference Card for R users.
Short Reference Card for R users.Dr. Volkan OBAN
 
Functional programming with_scala
Functional programming with_scalaFunctional programming with_scala
Functional programming with_scalaRaymond Tay
 
pandas dataframe notes.pdf
pandas dataframe notes.pdfpandas dataframe notes.pdf
pandas dataframe notes.pdfAjeshSurejan2
 
Data Analysis with Pandas CheatSheet .pdf
Data Analysis with Pandas CheatSheet .pdfData Analysis with Pandas CheatSheet .pdf
Data Analysis with Pandas CheatSheet .pdfErwin512140
 

Ähnlich wie Pandas,scipy,numpy cheatsheet (20)

R gráfico
R gráficoR gráfico
R gráfico
 
tidyr.pdf
tidyr.pdftidyr.pdf
tidyr.pdf
 
Pandas cheat sheet_data science
Pandas cheat sheet_data sciencePandas cheat sheet_data science
Pandas cheat sheet_data science
 
Pandas cheat sheet
Pandas cheat sheetPandas cheat sheet
Pandas cheat sheet
 
Data Wrangling with Pandas
Data Wrangling with PandasData Wrangling with Pandas
Data Wrangling with Pandas
 
R Programming Reference Card
R Programming Reference CardR Programming Reference Card
R Programming Reference Card
 
Broom: Converting Statistical Models to Tidy Data Frames
Broom: Converting Statistical Models to Tidy Data FramesBroom: Converting Statistical Models to Tidy Data Frames
Broom: Converting Statistical Models to Tidy Data Frames
 
R command cheatsheet.pdf
R command cheatsheet.pdfR command cheatsheet.pdf
R command cheatsheet.pdf
 
@ R reference
@ R reference@ R reference
@ R reference
 
Short Reference Card for R users.
Short Reference Card for R users.Short Reference Card for R users.
Short Reference Card for R users.
 
Reference card for R
Reference card for RReference card for R
Reference card for R
 
purrr.pdf
purrr.pdfpurrr.pdf
purrr.pdf
 
Functional programming with_scala
Functional programming with_scalaFunctional programming with_scala
Functional programming with_scala
 
20170509 rand db_lesugent
20170509 rand db_lesugent20170509 rand db_lesugent
20170509 rand db_lesugent
 
Data import-cheatsheet
Data import-cheatsheetData import-cheatsheet
Data import-cheatsheet
 
pandas dataframe notes.pdf
pandas dataframe notes.pdfpandas dataframe notes.pdf
pandas dataframe notes.pdf
 
3 Data Structure in R
3 Data Structure in R3 Data Structure in R
3 Data Structure in R
 
Data Analysis with Pandas CheatSheet .pdf
Data Analysis with Pandas CheatSheet .pdfData Analysis with Pandas CheatSheet .pdf
Data Analysis with Pandas CheatSheet .pdf
 
Python for R users
Python for R usersPython for R users
Python for R users
 
Frp2016 3
Frp2016 3Frp2016 3
Frp2016 3
 

Mehr von Dr. Volkan OBAN

Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...Dr. Volkan OBAN
 
Covid19py Python Package - Example
Covid19py  Python Package - ExampleCovid19py  Python Package - Example
Covid19py Python Package - ExampleDr. Volkan OBAN
 
Object detection with Python
Object detection with Python Object detection with Python
Object detection with Python Dr. Volkan OBAN
 
Python - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) ParametreleriPython - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) ParametreleriDr. Volkan OBAN
 
Linear Programming wi̇th R - Examples
Linear Programming wi̇th R - ExamplesLinear Programming wi̇th R - Examples
Linear Programming wi̇th R - ExamplesDr. Volkan OBAN
 
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ..."optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...Dr. Volkan OBAN
 
k-means Clustering in Python
k-means Clustering in Pythonk-means Clustering in Python
k-means Clustering in PythonDr. Volkan OBAN
 
Naive Bayes Example using R
Naive Bayes Example using  R Naive Bayes Example using  R
Naive Bayes Example using R Dr. Volkan OBAN
 
k-means Clustering and Custergram with R
k-means Clustering and Custergram with Rk-means Clustering and Custergram with R
k-means Clustering and Custergram with RDr. Volkan OBAN
 
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision MakingData Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision MakingDr. Volkan OBAN
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.Dr. Volkan OBAN
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleDr. Volkan OBAN
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleDr. Volkan OBAN
 
R-ggplot2 package Examples
R-ggplot2 package ExamplesR-ggplot2 package Examples
R-ggplot2 package ExamplesDr. Volkan OBAN
 
R Machine Learning packages( generally used)
R Machine Learning packages( generally used)R Machine Learning packages( generally used)
R Machine Learning packages( generally used)Dr. Volkan OBAN
 
treemap package in R and examples.
treemap package in R and examples.treemap package in R and examples.
treemap package in R and examples.Dr. Volkan OBAN
 
imager package in R and examples..
imager package in R and examples..imager package in R and examples..
imager package in R and examples..Dr. Volkan OBAN
 
R-Data table Cheat Sheet
R-Data table Cheat SheetR-Data table Cheat Sheet
R-Data table Cheat SheetDr. Volkan OBAN
 

Mehr von Dr. Volkan OBAN (20)

Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
Conference Paper:IMAGE PROCESSING AND OBJECT DETECTION APPLICATION: INSURANCE...
 
Covid19py Python Package - Example
Covid19py  Python Package - ExampleCovid19py  Python Package - Example
Covid19py Python Package - Example
 
Object detection with Python
Object detection with Python Object detection with Python
Object detection with Python
 
Python - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) ParametreleriPython - Rastgele Orman(Random Forest) Parametreleri
Python - Rastgele Orman(Random Forest) Parametreleri
 
Linear Programming wi̇th R - Examples
Linear Programming wi̇th R - ExamplesLinear Programming wi̇th R - Examples
Linear Programming wi̇th R - Examples
 
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ..."optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
"optrees" package in R and examples.(optrees:finds optimal trees in weighted ...
 
k-means Clustering in Python
k-means Clustering in Pythonk-means Clustering in Python
k-means Clustering in Python
 
Naive Bayes Example using R
Naive Bayes Example using  R Naive Bayes Example using  R
Naive Bayes Example using R
 
R forecasting Example
R forecasting ExampleR forecasting Example
R forecasting Example
 
k-means Clustering and Custergram with R
k-means Clustering and Custergram with Rk-means Clustering and Custergram with R
k-means Clustering and Custergram with R
 
Data Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision MakingData Science and its Relationship to Big Data and Data-Driven Decision Making
Data Science and its Relationship to Big Data and Data-Driven Decision Making
 
Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.Data Visualization with R.ggplot2 and its extensions examples.
Data Visualization with R.ggplot2 and its extensions examples.
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
 
ReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an exampleReporteRs package in R. forming powerpoint documents-an example
ReporteRs package in R. forming powerpoint documents-an example
 
R-ggplot2 package Examples
R-ggplot2 package ExamplesR-ggplot2 package Examples
R-ggplot2 package Examples
 
R Machine Learning packages( generally used)
R Machine Learning packages( generally used)R Machine Learning packages( generally used)
R Machine Learning packages( generally used)
 
treemap package in R and examples.
treemap package in R and examples.treemap package in R and examples.
treemap package in R and examples.
 
Mosaic plot in R.
Mosaic plot in R.Mosaic plot in R.
Mosaic plot in R.
 
imager package in R and examples..
imager package in R and examples..imager package in R and examples..
imager package in R and examples..
 
R-Data table Cheat Sheet
R-Data table Cheat SheetR-Data table Cheat Sheet
R-Data table Cheat Sheet
 

Kürzlich hochgeladen

Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachBoston Institute of Analytics
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...amitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...amitlee9823
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...gajnagarg
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...gajnagarg
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...karishmasinghjnh
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraGovindSinghDasila
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...amitlee9823
 
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...gajnagarg
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...gajnagarg
 

Kürzlich hochgeladen (20)

Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning Approach
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls Bellary Escorts ☎️9352988975 Two shot with one girl ...
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls Palakkad Escorts ☎️9352988975 Two shot with one girl...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
 

Pandas,scipy,numpy cheatsheet

  • 1. 1 www.quandl.com NumPy / SciPy / Pandas Cheat Sheet Select column. Select row by label. Return DataFrame index. Delete given row or column. Pass axis=1 for columns. Reindex df1 with index of df2. Reset index, putting old index in column named index. Change DataFrame index, new indecies set to NaN. Show first n rows. Show last n rows. Sort index. Sort columns. Pivot DataFrame, using new conditions. Transpose DataFrame. Change lowest level of column labels into innermost row index. Change innermost row index into lowest level of column labels. NumPy / SciPy arr = array([]) arr.shape convolve(a,b) arr.reshape() sum(arr) mean(arr) std(arr) dot(arr1,arr2) vectorize() Create a Series. Create a Dataframe. Create a Panel. Pandas Create Structures s = Series (data, index) df = DataFrame (data, index, columns) p = Panel (data, items, major_axis, minor_axis) df.stack() df.unstack() df.pivot(index,column,values) df.T DataFrame commands df[col] df.iloc[label] df.index df.drop() df1 = df1.reindex_like(df1,df2) df.reset_index() df.reindex() df.head(n) df.tail(n) df.sort() df.sort(axis=1) Create numpy array. Shape of an array. Linear convolution of two sequences. Reshape array. Sum all elements of array. Compute mean of array. Compute standard deviation of array. Compute inner product of two arrays. Turn a scalar function into one which accepts & returns vectors.
  • 2. 2 www.quandl.com Create a time series index.date_range(start, end, freq) Pandas Time Series Business Day Calender day Weekly Monthly Quarterly Annual Hourly B D W M Q A H Freq has many options including: Any Structure with a datetime index Split DataFrame by columns. Creates a GroupBy object (gb). Apply function (single or list) to a GroupBy object. Applies function and returns object with same index as one being grouped. Filter GroupBy object by a given function. Return dict whose keys are the unique groups, and values are axis labels belonging to each group. Groupby groupby() gb.agg() gb.transform() gb.filter() gb.groups Save to CSV. Read CSV into DataFrame. Save to Excel. Read exel into DataFrame. I/O df.to_csv(‘foo.csv’) read_csv(‘foo.csv’) to_excel(‘foo.xlsx’, sheet_name) read_excel(‘foo.xlsx’,’sheet1’, index_col = None, na_values = [‘NA’]) df.dropna() df.count() df.min() df.max() df.describe() concat() Drops rows where any data is missing. Returns Series of row counts for every column. Return minimum of every column. Return maximum of every column. Generate various summary statistics for every column. Merge DataFrame or Series objects. Apply function to every element in DataFrame. Apply function along a given axis. df.applymap() df.apply() Resample data with new frequency.ts.resample()
  • 3. 3 www.quandl.com Select current axis. Change axis color, none to remove. Change axis position. Can change coordinate space. Create legend. Set to ‘best’ for auto placement. Save plot. ax=gca() ax.spines[].set_color() ax.spines[].set_position() Label the x-axis. Label the y-axis. Title the graph. Set tick values for x-axis. First array for values, second for labels. Set tick values for y-axis. First array for values, second for labels. yticks([],[]) Plot data or plot a function against a range. Create multiple plots; n- number of plots, x - number horizontally displayed, y- number vertically displayed. plot() subplot(n,x,y) xlabel() ylabel() title() xticks([],[]) Plotting Matplotlib is an extremely powerful module. See www.matplotlib.org for complete documentation. Quandl is a search engine for numerical data, allowing easy access to financial, social, and demographic data from hundreds of sources. Quandl The Quandl package enables Quandl API access from within Python, which makes acquiring and manipulating numerical data as quick and easy as possible. In your first Quandl function call you should specifiy your authtoken (found on Quandl’s website after signing up) to avoid certain API call limits. See www.quandl.com/help/packages/python for more. savefig(‘foo.png’) legend(loc=’ ‘) Return data for nearest time interval. Return data for specific time. Return data between specific interval. Convert Pandas DatetimeIndex to datetime.datetime object. Conver a list of date-like objects (strings, epochs, etc.) to a DatetimeIndex. ts.ix[start:end] ts[] ts.between_time() to_pydatetime() to_datetime()
  • 4. 4 www.quandl.com Plotting Example import Quandl as q import matplotlib.pyplot as plt rural = q.get(‘WORLDBANK/USA_SP_RUR_TOTL_ZS’) urban = q.get(‘WORLDBANK/USA_SP_URB_TOTL_IN_ZS’) plt.subplot(2, 1, 1) plt.plot(rural.index,rural) plt.xticks(rural.index[0::3],[]) plt.title(‘American Population’) plt.ylabel(‘% Rural’) plt.subplot(2, 1, 2) plt.plot(urban.index,urban) plt.xlabel(‘year’) plt.ylabel(‘% Urban’) plt.show() Add the following to any function call. Download Quandl data for a certain Quandl code as a Dataframe. Search Quandl. Outputs first 4 results. Upload a Pandas DataFrame (with a time series index) to Quandl. Code must be all capital alphanumeric. authtoken = ‘YOURTOKENHERE’ get(‘QUANDL/CODE’) search(‘searchterm’) push(data, code, name)