Which one of the following syntaxes is used to import a csv file by considering special characters as NaN?
1) pandas.read_csv(file_name.csv, true_values = [ ])
2) pandas.read_csv(file_name.csv, na_values = [ ])
3) pandas.read_csv(file_name.csv, skiprows = [ ]) 4)pandas.read_csv(file_name.csv, na_filter = [ ])
Answers
Answered by
0
Answer:
2) pandas.read_csv(file_name.csv, na_values = [ ])
Explanation:
Pandas is "Python Data Analysis Library", it allows to take data from a csv i.e. comma separated file.
read_csv() allows multiple parameters and one of them is na_values which allows values like str, scalar, list-like, dict. It allows additional strings to be recognized as NA/NaN. If dict passed, specific per-column NA values or by default the following values are interpreted as NaN: ‘’, ‘#N/A’, ‘#N/A N/A’, ‘#NA’, ‘-1.#IND’, ‘-1.#QNAN’, ‘-NaN’, ‘-nan’, ‘1.#IND’, ‘1.#QNAN’, ‘<NA>’, ‘N/A’, ‘NA’, ‘NULL’, ‘NaN’, ‘n/a’, ‘nan’, ‘null’.
#SPJ3
Answered by
0
2) pandas.read_csv(file_name.csv, na_values = [ ])
- Using CSV (comma-separated values) files is an easy way to store large amounts of data.
- Plain text is present in CSV files, which are a common format that anybody can read, including Pandas.
- The most often used open-source Python library for data science, data analysis, and machine learning activities is called Pandas.
- It is constructed on top of Numpy, a different package that supports multi-dimensional arrays.
- The syntax is used to import a CSV file by considering special characters as NaN is pandas.read_csv(file_name.csv, na_values = [ ])
#SPJ3
Similar questions