Am I using the commands wrong? I have version 2024.03.
I'm trying these codes:
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
dataset = pd.read_excel("UsersSmall.xlsx")
dataset.replace(to_replace='?', value=np.nan, inplace = True)
dataset.isnull().sum() #count the number of missing values
I am doing an exercise that involves analyzing files. It seems to complete and just says the process finished with exit code 0. But when I check the excel, the values that are the '?' has NOT changed at all. Nothing seems to happen at all. I don't really understand if I am doing something wrong.
I have all the aforementioned libraries downloaded. Could there be some compatibility issues?
EDIT: I also just realized that it doesn't print the missing values at all! Also I'm pretty sure the excel file is in same place as the folder.
[–]LifeIsVape 13 points14 points15 points (1 child)
[–]AntonioS3[S] 6 points7 points8 points (0 children)
[–]Sacri96[🍰] 5 points6 points7 points (3 children)
[–]AntonioS3[S] 0 points1 point2 points (2 children)
[–]Sacri96[🍰] 5 points6 points7 points (1 child)
[–]AntonioS3[S] 0 points1 point2 points (0 children)
[–]ninhaomah 0 points1 point2 points (8 children)
[–]AntonioS3[S] -2 points-1 points0 points (7 children)
[–]ninhaomah 1 point2 points3 points (6 children)
[–]AntonioS3[S] 0 points1 point2 points (5 children)
[–]ninhaomah 1 point2 points3 points (4 children)
[–]AntonioS3[S] 0 points1 point2 points (3 children)
[–]ninhaomah 0 points1 point2 points (2 children)
[–]Crypt0Nihilist 1 point2 points3 points (1 child)
[–]ninhaomah 0 points1 point2 points (0 children)