Posts

Showing posts from August, 2020

null values

  Null Values You need to do something about the null values. There are several popular choices when dealing with null values: Eliminate the rows: A great approach if null values are a very small percentage, such as 1% of the total dataset. However, if data is limited, it is not wise to lose the precious data. Replace with a significant value, such as the median or the mean: A great approach if the rows are valuable, and the column is reasonably balanced. However, all the data with the missing values are inputted with the same value which is practically not true. Replace with the most likely value, perhaps a 0 or 1: It's preferable to option 2 when the median might be useless. The median can often work here. Other advance techniques include the estimating the data using machine learning based model such as KNN, Random Forest, and so on, and that is out of the scope of this book. This process of filling the null values with an appropriate number is known as imputation of the data. d

call out for reading dataset in various other format

Image
 

few short codes.

Image
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  f= open("pg37431.txt") text= f.read() print(text) ............................................................................ output: veatdughjpjujhig ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: file=open("pg37431.txt") text=file.read(5) print(text) ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  this is how to write a text file. ........................................... file=open("annielog.txt",'w') file.write("hi there i am animesh\n hope you are doing well /nsmart") :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::