From the course: Python Data Analysis

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Special arrays: Records and dates

Special arrays: Records and dates - Python Tutorial

From the course: Python Data Analysis

Start my 1-month free trial

Special arrays: Records and dates

- [Instructor] In the last video for this chapter, I want to show you two NumPy features that are not always covered in tutorials, but they're still very useful. One is record arrays, where we can mix different data types and give descriptive names to fields. The other is date time objects, which as the name says, can encode a date and time. Let us load up a simple example of a record array, which I have prepared in the NumPy binary format. This is a partial David Bowie discography. Each entry shows the record name, the date of release and the top rank in the UK charts. Let's look at the data type. It's a list which shows the name of each field and the actual D type. For title, it's U32, which denotes a Unicode string of maximum length 32. For release, it's M eight brackets D which denotes a date time object with granularity of days. It could be as small as a nanosecond in fact. The eight refers to the size in bytes of…

Contents