saving . . . saved Loading of files has been deleted. Loading of files has been hidden .
Loading of files
Title
Question
The content of prime.txt file is pure integers which are saved as text file...Why the numbers when displayed are in float ????? 

Python loading-data-from-files 02-03 min 30-40 sec 22-06-19, 3:51 p.m. Krishnendu_HVM

Answers:

because loadtxt default return type is float
22-06-19, 3:56 p.m. PriyaBhatnagar
thanks

22-06-19, 4:36 p.m. Krishnendu_HVM

Login to add comment


By default numpy loads the data using float data type. Hence the data is in float. If you want to load data as integers you can pass dtype argument as int e.g loadtxt("prime.txt", dtype=int)
22-06-19, 3:58 p.m. iakashchavan
thanks
22-06-19, 4:36 p.m. Krishnendu_HVM

Login to add comment


Log-in to answer to this question.