Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
suyashi29
GitHub Repository: suyashi29/python-su
Path: blob/master/Key Python Libraries - Day 1.ipynb
3064 views
Kernel: Python 3

Python library is a collection of functions and methods that allows you to perform lots of actions without writing your own code.Here, a ‘library’ loosely describes a collection of core modules.

image.png

Data Science and Machine Learning

  • Numpy and Scipy – Fundamental Scientific Computing

  • Pandas – Data Manipulation and Analysis

  • StatsModels – Statistical Modeling, Testing, and Analysis

  • Matplotlib – Plotting and Visualization

  • Seaborn – For Statistical Data Visualization

  • Scikit-learn – Machine Learning and Data Mining

  • Keras- Machine learning

  • PyTorch- Machine Learning Tensor Flow

  • LightGBM- Machine Learning(Model Optimization)

  • Tensor Flow - Machine Learning

  • Eli5- Machine learning models(Debugging)

  • Theano- AI and ML

  • NLTK - Natural Language Processing with Python

  • SQLAlchemy- Database access

Web Development Frameworks and GUI

  • Tkinter – GUI applications

  • Requests – HTTP requests

  • Django- Web framework

  • Scrapy- Web crawling frameworks

  • BeautifulSoup - web crawling and data scraping

  • Flask - Micro-web framework

Others

  • Pyspark - Support Python with Spark, Apache Spark community released a tool, PySpark

  • TabPy - TabPy (the Tableau Python Server) is an Analytics Extension implementation which expands Tableau’s capabilities by allowing users to execute Python scripts and saved functions via Tableau’s table calculations

  • Jython- Jython an implementation of the Python programming language designed to run on the Java platform

import numpy as np L1=np.array([1,2,3,4]) L1
array([1, 2, 3, 4])

scipy.special package contains numerous functions of mathematical physics.

SciPy special function includes Cubic Root, Exponential, Log sum Exponential, Lambert, Permutation and Combinations, Gamma, Bessel, hypergeometric, Kelvin, beta, parabolic cylinder, Relative Error Exponential, etc..

import scipy.special import numpy as np import scipy.stats x = np.arange(10, 20) y = np.array([2, 1, 4, 5, 8, 12, 18, 25, 96, 48]) result = scipy.stats.linregress(x, y) print("slope=" ,result.slope) print("Intercept= ",result.intercept) #help(scipy.special)
slope= 7.4363636363636365 Intercept= -85.92727272727274
import pandas as pd pd.Series((1,2,34,35))
0 1 1 2 2 34 3 35 dtype: int64
pd.DataFrame(((1,"A"),(2,"B"),(3,"C")))
chicago_data = pd.read_csv("Chicago.csv") chicago_data
chicago_data.describe()
chicago_data.isnull().sum()
ID 0 CASE_NUMBER 0 DATE 0 BLOCK 0 IUCR 0 PRIMARY_TYPE 0 DESCRIPTION 0 LOCATION_DESCRIPTION 0 ARREST 0 DOMESTIC 0 BEAT 0 DISTRICT 0 WARD 43 COMMUNITY_AREA_NUMBER 43 FBICODE 0 X_COORDINATE 4 Y_COORDINATE 4 YEAR 0 UPDATEDON 0 LATITUDE 4 LONGITUDE 4 LOCATION 4 dtype: int64
chicago_data.corr(method ='pearson')
pip install pandas-profiling
Note: you may need to restart the kernel to use updated packages.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/pandas-profiling/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/pandas-profiling/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/pandas-profiling/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/pandas-profiling/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/pandas-profiling/ ERROR: Could not find a version that satisfies the requirement pandas-profiling (from versions: none) ERROR: No matching distribution found for pandas-profiling
import pandas_profiling as pro profile = pro.ProfileReport(chicago_data) profile
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) <ipython-input-13-25e1b4eaf364> in <module> ----> 1 import pandas_profiling as pro 2 profile = pro.ProfileReport(chicago_data) 3 profile ModuleNotFoundError: No module named 'pandas_profiling'
pip install sweetviz
Note: you may need to restart the kernel to use updated packages.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/sweetviz/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/sweetviz/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/sweetviz/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/sweetviz/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', OSError(0, 'Error'))': /simple/sweetviz/ ERROR: Could not find a version that satisfies the requirement sweetviz (from versions: none) ERROR: No matching distribution found for sweetviz
#pip install sweetviz import sweetviz as sv sweet_report = sv.analyze(chicago_data) sweet_report.show_html('sweet_report.html')
df1 = sv.compare(chicago_data[0:],chicago_data [:3]) df1.show_html('Compare.html')
#pip install autoviz from autoviz.AutoViz_Class import AutoViz_Class AV = AutoViz_Class()
viz = AV.AutoViz("imdb.csv")
import matplotlib %matplotlib inline
#pip install autoviz