Python Forum
Removing Certain Numbers From File
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing Certain Numbers From File
#3
(Feb-07-2020, 03:45 PM)paul18fr Wrote: Hi

My advice is by:
  • creating an array with all the numbers
  • using the modulo property (see numpy.mod) by an additional column
  • then looking for values where the rest is equal to zero (see numpy.where)
  • and finally deleting the corresponding rows (see numpy.delete)

Paul


Hi Paul,

When trying to use numpy.mod I get the following error

TypeError: ufunc 'remainder' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

can you provide any solutions for this? I am new to using python so appreciate any and all help.

Thanks.
Reply


Messages In This Thread
Removing Certain Numbers From File - by chascp - Feb-07-2020, 03:23 PM
RE: Removing Certain Numbers From File - by chascp - Feb-07-2020, 04:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Removing the unwanted data from a file jehoshua 14 4,134 Feb-01-2022, 09:56 PM
Last Post: jehoshua
  Calcolate the average of numbers from a .txt file francescomiles 2 3,044 Mar-27-2021, 02:43 PM
Last Post: francescomiles
  Read strings and numbers in columns from a file suvadip 4 2,942 Aug-11-2020, 09:37 PM
Last Post: suvadip
  removing duplicate numbers from a list calonia 12 5,354 Jun-16-2019, 12:09 PM
Last Post: DeaD_EyE
  Print Numbers starting at 1 vertically with separator for output numbers Pleiades 3 3,764 May-09-2019, 12:19 PM
Last Post: Pleiades
  writing numbers to csv file SchroedingersLion 7 4,091 Dec-20-2018, 10:48 AM
Last Post: perfringo
  Help deleting numbers from file names Shane 5 4,886 Feb-04-2018, 10:42 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020