How do you handle missing values in python or r?



How do you handle missing values in python or r?..

Answer / Hiba Jainab

In Python, missing values are typically represented by NaN (Not a Number) for numerical data and NaN or None for categorical data. In R, missing values are also represented by NA for both numerical and categorical data. To handle these missing values, you can use various methods like mean imputation (filling the missing value with the mean of the column), median imputation (filling the missing value with the median of the column), or using advanced techniques like k-nearest neighbors or multiple imputation.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Science Interview Questions

How to determine the number of clusters in k-means clustering algorithm?

1 Answers  


You are given a training dataset of users that contain their demographic details, the pages on Facebook they have liked so far and results of psychology test based on their personality i.e. their openness to like FB pages or not. How will you predict the age, gender and other demographics of unseen data?

1 Answers   American Express,


What do you understand by parametric and non-parametric methods? Explain with examples.

1 Answers   WalMart,


What is random forests and how is it different from decision trees?

1 Answers  


What data structures are available in the Pandas package in Python programming language?

1 Answers   WalMart,


Differentiate between skewed and uniform distribution?

1 Answers  


How can you check if a data set or time series is random?

1 Answers  


A certain couple tells you that they have two children, at least one of which is a girl. What is the probability that they have two girls?

1 Answers  


How will you drop variables using indices in a data frame?

1 Answers  


What are the various classification algorithms?

1 Answers  


What is an rdbms? Name some examples for rdbms? What is crud?

1 Answers  


Please explain eigenvectors and eigenvalues?

1 Answers  


Categories
  • AI Algorithms Interview Questions AI Algorithms (74)
  • AI Natural Language Processing Interview Questions AI Natural Language Processing (96)
  • AI Knowledge Representation Reasoning Interview Questions AI Knowledge Representation Reasoning (12)
  • AI Robotics Interview Questions AI Robotics (183)
  • AI Computer Vision Interview Questions AI Computer Vision (13)
  • AI Neural Networks Interview Questions AI Neural Networks (66)
  • AI Fuzzy Logic Interview Questions AI Fuzzy Logic (31)
  • AI Games Interview Questions AI Games (8)
  • AI Languages Interview Questions AI Languages (141)
  • AI Tools Interview Questions AI Tools (11)
  • AI Machine Learning Interview Questions AI Machine Learning (659)
  • Data Science Interview Questions Data Science (671)
  • Data Mining Interview Questions Data Mining (120)
  • AI Deep Learning Interview Questions AI Deep Learning (111)
  • Generative AI Interview Questions Generative AI (153)
  • AI Frameworks Libraries Interview Questions AI Frameworks Libraries (197)
  • AI Ethics Safety Interview Questions AI Ethics Safety (100)
  • AI Applications Interview Questions AI Applications (427)
  • AI General Interview Questions AI General (197)
  • AI AllOther Interview Questions AI AllOther (6)