Anwendungsfall für Interpolation (Pandas) und linearer Raum (Numpy)Python

Python-Programme
Anonymous
 Anwendungsfall für Interpolation (Pandas) und linearer Raum (Numpy)

Post by Anonymous »

Was ist der Unterschied zwischen der Verwendung einer Interpolation im Pandas -Paket und dem linearen Raum des Numpy -Pakets? Zum Beispiel in Folgendes: < /p>

Code: Select all

import numpy as np
import pandas as pd

In [12]: np.linspace(1, 4, 7)
Out[12]: array([1. , 1.5, 2. , 2.5, 3. , 3.5, 4. ])

In [13]: pd.Series([1]+[np.nan]*5+[4]).interpolate()
Out[13]:
0    1.0
1    1.5
2    2.0
3    2.5
4    3.0
5    3.5
6    4.0
dtype: float64
Ist ihr Anwendungsfall ausgetauscht, und Linspace hat im Grunde genommen den gleichen Anwendungsfall wie eine Interpolation?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post