enter image description here I have a database in txt format and I just want to read numbers in float format. By what order is this possible? From line 9 to 254126 And columns 0 to 31 https://i.stack.imgur.com/WV6mu.png
Asked
Active
Viewed 50 times
-3
-
can you show an example of your txt file? – Flow May 29 '22 at 16:04
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 29 '22 at 16:09
2 Answers
0
Assuming each float is on a new line
with open(filename) as file:
lines = file.readlines()
allNums = [float(line.rstrip()) for line in lines]

Xinurval
- 44
- 3
0
pd.read_csv('/content/dummy.txt', usecols=list(range(0,32)),nrows=254126, skiprows=8)

BanTi
- 1
- 1
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 29 '22 at 16:56