Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning NumPy Array

You're reading from  Learning NumPy Array

Product type Book
Published in Jun 2014
Publisher
ISBN-13 9781783983902
Pages 164 pages
Edition 1st Edition
Languages
Author (1):
Ivan Idris Ivan Idris
Profile icon Ivan Idris

Table of Contents (14) Chapters

Learning NumPy Array
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with NumPy 2. NumPy Basics 3. Basic Data Analysis with NumPy 4. Simple Predictive Analytics with NumPy 5. Signal Processing Techniques 6. Profiling, Debugging, and Testing 7. The Scientific Python Ecosystem Index

Analyzing atmospheric humidity in De Bilt


Relative atmospheric humidity is the percentage of partial water vapor pressure of the maximum pressure at the same temperature in the atmosphere. During the summer months, high humidity can lead to issues with getting rid of excess heat by sweating. Humidity is also related to rain, dew, and fog. The KNMI De Bilt data file provides data on daily relative average, minimum, and maximum humidity in percentages. We will draw a histogram of the daily relative average humidity and monthly chart:

  1. We will load the dates converted to months, daily relative average humidity, and the minimum and maximum humidity into NumPy arrays. Again, missing values needed to be converted into NaNs:

    to_float = lambda x: float(x.strip() or np.nan)
    to_month = lambda x: dt.strptime(x, "%Y%m%d").month
    months, avg_h, max_h, min_h = np.loadtxt(sys.argv[1], delimiter=',', usecols=(1, 35, 36, 38), unpack=True, converters={1: to_month, 35: to_float, 36: to_float, 38: to_float})
  2. Values...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}