Skip to content

qoncept/swift-npy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftNpy

Save/Load NumPy array files in Swift

let npy = try Npy(contentsOf: npyUrl)
let shape = npy.shape
let elements: [Float] = npy.elements()
let isFortranOrder = npy.isFortranOrder
try save(npy: npy, to: url)
let npz = try Npz(contentsOf: npzUrl)
let npy = npz["name-of-array"]
try npz.save(to: url)

Suppoted formats

npy, npz files.

Bool

Bool

UInt

UInt8, UInt16, UInt32, UInt64
They also can be read as UInt

Int

Int8, Int16, Int32, Int64
They also can be read as Int

Float, Double

Float, Double

License

The MIT License

About

Save/Load NumPy array files in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages