从给定熊猫数据框中删除无限值
让我们讨论如何从熊猫数据框中移除无限值。首先,让我们制作一个数据帧:
例:
蟒 3
# Import Required Libraries
import pandas as pd
import numpy as np
# Create a dictionary for the dataframe
dict = {'Name': ['Sumit Tyagi', 'Sukritin', 'Akriti Goel',
'Sanskriti', 'Abhishek Jain'],
'Age': [22, 20, np.inf, -np.inf, 22],
'Marks': [90, 84, 33, 87, 82]}
# Converting Dictionary to Pandas Dataframe
df = pd.DataFrame(dict)
# Print Dataframe
df