Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Numpy exercise
  • pandas
  • Matplotlib
  • Data visulisation
  • EDA
  • Machin Learning
  • Deep Learning
  • NLP
  • Data science
  • ML Tutorial
  • Computer Vision
  • ML project
Open In App
Next Article:
Convert a Hermite series to a polynomial in Python
Next article icon

Convert a Hermite series to a polynomial in Python

Last Updated : 09 Dec, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

In this article, we will be looking at the step-wise procedure to convert a Hermite series to a polynomial in Python.

NumPy.herm2poly method

To convert a Hermite series to a polynomial, use the np.herm2poly() function from the Numpy package of python. Convert the given array representing the coefficients of a Hermite series, ordered from lowest degree to highest, to an array of the coefficients of the equivalent polynomial (relative to the “standard” basis) ordered from lowest to the highest degree.

Syntax: np.herm2poly(hermite series)

Parameter:

  • hermite series: 1-D array

Return: Return the coefficient of polynomial.

Stepwise Implementation:

Step 1: In this step, we are importing the required packages needed.

Python3
import numpy as np from numpy.polynomial import hermite 

Step 2: In this step, we are creating an array containing 10 coefficients and displaying it.

Python3
gfg = np.array([1,2,3,4,5,6,7,8,9,10])  print(gfg) 

Output:

[ 1  2  3  4  5  6  7  8  9 10]

Step 3: In this step we are checking the dimension and the datatype of the array created in step 2. 

Python3
print("Dimensions of our Array:-",gfg.ndim)  print("\nDatatype of  Array:-",gfg.dtype) 

Output:

Dimensions of our Array:- 1 Datatype of  Array:- int64

Step 4: In this step, we are checking the shape of the array created in step 2.

Python3
print("\nShape of  Array:-",gfg.shape) 

Output:

Shape of  Array:- (10,)

Step 5: This is the final step where we are using the np.herm2poly()  function to Hermite series to a polynomial:

Python3
print("\n Converting Hermite series to a polynomial",        hermite.herm2poly(gfg)) 

Example:

This method returns a 1-D array containing the coefficients of the equivalent polynomial (relative to the “standard” basis) ordered from lowest order term to highest. The parameter passed is a 1-D array containing the Hermite series coefficients, ordered from the lowest order term to the highest.

Python3
import numpy as np from numpy.polynomial import hermite  gfg = np.array([1,2,3,4,5,6,7,8,9,10])  print(gfg) print("\nDimensions of our Array:-",gfg.ndim) print("\nDatatype of  Array:-",gfg.dtype) print("\nShape of  Array:-",gfg.shape) print("\n Converting Hermite series to a polynomial",hermite.herm2poly(gfg)) 

Output:

[ 1  2  3  4  5  6  7  8  9 10]

Dimensions of our Array:- 1

Datatype of  Array:- int64

Shape of  Array:- (10,)

 Converting Hermite series to a polynomial [  14335.  289636. -116148. -780448.  117680.  473280.  -31808.  -91136. 2304.    5120.]


Next Article
Convert a Hermite series to a polynomial in Python

G

geetansh044
Improve
Article Tags :
  • Python
  • Python-numpy
  • Python numpy-polynomials
Practice Tags :
  • python

Similar Reads

    Convert a polynomial to Hermite_e series using NumPy in Python
    In this article, we will cover how to convert a polynomial to Hermite_e series using NumPy in Python. hermite_e.poly2herme method We use the hermite_e.poly2herme() function present in the NumPy module of python to convert a polynomial to a Hermite series. Here we need to convert an array of polynomi
    2 min read
    Convert a Laguerre series to a polynomial in Python
    Laguerre polynomials are a sequence of orthogonal polynomials that arise in various problems in physics and engineering, particularly in quantum mechanics and numerical analysis. They are solutions to Laguerre's differential equation and are used to express functions in terms of a series expansion k
    3 min read
    Convert a polynomial to Laguerre series in Python
    Laguerre polynomials are a sequence of orthogonal polynomials widely used in physics and engineering, particularly in quantum mechanics and numerical analysis. They are solutions to Laguerre's differential equation and are used to express functions in terms of a series expansion known as a Laguerre
    4 min read
    Convert a Polynomial to Hermite Series Using NumPy
    In this article, we will discuss how to convert a Polynomial to Hermite series using NumPy. Example: Polynomial: [4 2 3 6] Coefficients of the converted equivalent Hermite series : [5.5  5.5  0.75 0.75] To convert a polynomial to Hermite series we need to use numpy methods hermite.poly2herm(). We ca
    2 min read
    Python NumPy - Convert a Polynomial to a Chebyshev series
    In this article, we are going to see how to convert a polynomial to a Chebyshev series in Python using NumPy. polynomial.chebyshev.poly2cheb() method The polynomial.chebyshev.poly2cheb() method from the NumPy library converts a polynomial to a Chebyshev series in python. This method is used to Conve
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences