NumPy Array: руководство для начинающих

–°–ø–∏—Å–æ–∫ - —ç—Ç–æ —Ç–∏–ø –¥–∞–Ω–Ω—ã—Ö, —Å–æ–¥–µ—Ä–∂–∞—â–∏–π —É–ø–æ—Ä—è–¥–æ—á–µ–Ω–Ω—É—é –ø–æ—Å–ª–µ–¥–æ–≤–∞—Ç–µ–ª—å–Ω–æ—Å—Ç—å —ç–ª–µ–º–µ–Ω—Ç–æ–≤. –°–ø–∏—Å–∫–∏ - –ø–æ–ª–µ–∑–Ω—ã–π —Ç–∏–ø –¥–∞–Ω–Ω—ã—Ö, –ø–æ—Å–∫–æ–ª—å–∫—É –æ–Ω–∏ –ø–æ–∑–≤–æ–ª—è—é—Ç —Ö—Ä–∞–Ω–∏—Ç—å –Ω–µ—Å–∫–æ–ª—å–∫–æ —Å–≤—è–∑–∞–Ω–Ω—ã—Ö –∑–Ω–∞—á–µ–Ω–∏–π –≤ –æ–¥–Ω–æ–π –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π. –° –ø–æ–º–æ—â—å—é —Å–ø–∏—Å–∫–∞ –≤—ã –º–æ–∂–µ—Ç–µ —Å–æ—Ö—Ä–∞–Ω–∏—Ç—å –Ω–∞–∑–≤–∞–Ω–∏—è 10 –ø–∞—Ä –æ–±—É–≤–∏ –≤ –æ–¥–Ω–æ–π –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π; –≤—ã –º–æ–∂–µ—Ç–µ —Å–æ—Ö—Ä–∞–Ω–∏—Ç—å —Å–ø–∏—Å–æ–∫ –ø–æ–∫—É–ø–æ–∫, –∫–æ—Ç–æ—Ä—ã–µ –≤—ã —Å–¥–µ–ª–∞–ª–∏ –≤ –º–∞–≥–∞–∑–∏–Ω–µ, –≤ –æ–¥–Ω–æ–π –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π.

–•–æ—Ç—è –≤—Å—Ç—Ä–æ–µ–Ω–Ω—ã–π —Ç–∏–ø –¥–∞–Ω–Ω—ã—Ö —Å–ø–∏—Å–∫–∞ —É–∂–µ —è–≤–ª—è–µ—Ç—Å—è –º–æ—â–Ω—ã–º, –¥–ª—è –±–æ–ª–µ–µ —Å–ª–æ–∂–Ω—ã—Ö –≤–∞—Ä–∏–∞–Ω—Ç–æ–≤ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏—è –æ–Ω –º–æ–∂–µ—Ç –æ–∫–∞–∑–∞—Ç—å—Å—è –Ω–µ–¥–æ—Å—Ç–∞—Ç–æ—á–Ω—ã–º. –í–æ—Ç –≥–¥–µ –ø—Ä–∏–≥–æ–¥–∏—Ç—Å—è —Ç–∏–ø –¥–∞–Ω–Ω—ã—Ö –º–∞—Å—Å–∏–≤–∞ NumPy. –ë–∏–±–ª–∏–æ—Ç–µ–∫—É NumPy –º–æ–∂–Ω–æ –ª–µ–≥–∫–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥–ª—è —Å–æ–∑–¥–∞–Ω–∏—è –º–∞—Å—Å–∏–≤–æ–≤ —Å –Ω–µ—Å–∫–æ–ª—å–∫–∏–º–∏ –∏–∑–º–µ—Ä–µ–Ω–∏—è–º–∏.

–í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã –ø–æ–≥–æ–≤–æ—Ä–∏–º –æ —Ç–æ–º, —á—Ç–æ –ú–∞—Å—Å–∏–≤—ã NumPy, –ø–æ—á–µ–º—É –æ–Ω–∏ –ø–æ–ª–µ–∑–Ω—ã –∏ –∫–∞–∫ –≤—ã –º–æ–∂–µ—Ç–µ —Ä–∞–±–æ—Ç–∞—Ç—å —Å –Ω–∏–º–∏ –≤ —Å–≤–æ–µ–º –∫–æ–¥–µ. –ü—Ä–∏—Å—Ç—É–ø–∏–º!

–ß—Ç–æ —Ç–∞–∫–æ–µ –º–∞—Å—Å–∏–≤ NumPy?

–ú–∞—Å—Å–∏–≤ NumPy - —ç—Ç–æ –æ–±—ä–µ–∫—Ç –º–∞—Å—Å–∏–≤–∞, –∏—Å–ø–æ–ª—å–∑—É–µ–º—ã–π –≤ –±–∏–±–ª–∏–æ—Ç–µ–∫–µ NumPy Python. NumPy, —á—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç —á–∏—Å–ª–æ–≤–æ–π Python, –ø—Ä–µ–¥—Å—Ç–∞–≤–ª—è–µ—Ç —Å–æ–±–æ–π –ø–∞–∫–µ—Ç, –∫–æ—Ç–æ—Ä—ã–π —á–∞—Å—Ç–æ –∏—Å–ø–æ–ª—å–∑—É–µ—Ç—Å—è –¥–ª—è –Ω–∞—É—á–Ω—ã—Ö –∏ –º–∞—Ç–µ–º–∞—Ç–∏—á–µ—Å–∫–∏—Ö –≤—ã—á–∏—Å–ª–µ–Ω–∏–π. –ö –Ω–µ–º—É –ø—Ä–∏–ª–∞–≥–∞–µ—Ç—Å—è —Ä—è–¥ –∏–Ω—Å—Ç—Ä—É–º–µ–Ω—Ç–æ–≤, –∫–æ—Ç–æ—Ä—ã–µ –º–æ–≥—É—Ç –ø–æ–º–æ—á—å —Å –∞–Ω–∞–ª–∏–∑–æ–º –¥–∞–Ω–Ω—ã—Ö –∏ –ø—Ä–æ–¥–≤–∏–Ω—É—Ç–æ–π –º–∞—Ç–µ–º–∞—Ç–∏–∫–æ–π. & Nbsp;

–í –æ–±—ã—á–Ω–æ–º Python (Python –±–µ–∑ –∫–∞–∫–∏—Ö-–ª–∏–±–æ –≤–Ω–µ—à–Ω–∏—Ö –ø–∞–∫–µ—Ç–æ–≤) –º–∞—Å—Å–∏–≤—ã - —ç—Ç–æ –º–æ—â–Ω–æ–µ —Å—Ä–µ–¥—Å—Ç–≤–æ , –Ω–æ –∏—Ö –æ–±—Ä–∞–±–æ—Ç–∫–∞ –º–æ–∂–µ—Ç –±—ã—Ç—å –º–µ–¥–ª–µ–Ω–Ω–æ–π. –° –¥—Ä—É–≥–æ–π —Å—Ç–æ—Ä–æ–Ω—ã, –º–∞—Å—Å–∏–≤—ã NumPy —Å—Ç—Ä–µ–º—è—Ç—Å—è –±—ã—Ç—å –Ω–∞ –Ω–µ—Å–∫–æ–ª—å–∫–æ –ø–æ—Ä—è–¥–∫–æ–≤ –±—ã—Å—Ç—Ä–µ–µ, —á–µ–º —Ç—Ä–∞–¥–∏—Ü–∏–æ–Ω–Ω—ã–π –º–∞—Å—Å–∏–≤ Python.

–¢–∞–∫–æ–µ –ø–æ–≤—ã—à–µ–Ω–∏–µ –ø—Ä–æ–∏–∑–≤–æ–¥–∏—Ç–µ–ª—å–Ω–æ—Å—Ç–∏ –¥–æ—Å—Ç–∏–≥–∞–µ—Ç—Å—è –∑–∞ —Å—á–µ—Ç —Ç–æ–≥–æ, —á—Ç–æ –º–∞—Å—Å–∏–≤—ã NumPy —Ö—Ä–∞–Ω—è—Ç –∑–Ω–∞—á–µ–Ω–∏—è –≤ –æ–¥–Ω–æ–º –Ω–µ–ø—Ä–µ—Ä—ã–≤–Ω–æ–º –º–µ—Å—Ç–µ –≤ –ø–∞–º—è—Ç–∏. –≠—Ç–æ —É–ø—Ä–æ—â–∞–µ—Ç Python –¥–æ—Å—Ç—É–ø –∫ —Å–ø–∏—Å–∫—É –∏ —É–ø—Ä–∞–≤–ª–µ–Ω–∏–µ –∏–º.

–ö–∞–∫ –æ–±—ä—è–≤–∏—Ç—å –º–∞—Å—Å–∏–≤ NumPy

–î–ª—è –Ω–∞—á–∞–ª–∞ –¥–∞–≤–∞–π—Ç–µ –Ω–∞—Å—Ç—Ä–æ–∏–º –º–∞—Å—Å–∏–≤ NumPy. –í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è —Ö—Ä–∞–Ω–∏—Ç—å —Å—Ç—Ä–æ–∫–æ–≤—ã–µ –∑–Ω–∞—á–µ–Ω–∏—è –≤ –Ω–∞—à–µ–º –º–∞—Å—Å–∏–≤–µ. –≠—Ç–∏ —Å—Ç—Ä–æ–∫–æ–≤—ã–µ –∑–Ω–∞—á–µ–Ω–∏—è –ø—Ä–µ–¥—Å—Ç–∞–≤–ª—è—é—Ç —Å–æ–±–æ–π —Å–ø–∏—Å–æ–∫ —Å–ª–∞–¥–æ—Å—Ç–µ–π, –ø—Ä–µ–¥–ª–∞–≥–∞–µ–º—ã—Ö –≤ –º–µ—Å—Ç–Ω–æ–π –∫–æ—Ñ–µ–π–Ω–µ. –ú—ã –Ω–∞—á–Ω–µ–º —Å –∏–º–ø–æ—Ä—Ç–∞ –±–∏–±–ª–∏–æ—Ç–µ–∫–∏ NumPy:

–≠—Ç–∞ —Å—Ç—Ä–æ–∫–∞ –∫–æ–¥–∞ –∏–º–ø–æ—Ä—Ç–∏—Ä—É–µ—Ç numpy –∏–∑ Python –∏ –ø—Ä–∏—Å–≤–∞–∏–≤–∞–µ—Ç –±–∏–±–ª–∏–æ—Ç–µ–∫–µ –∏–º—è np. –≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –≤—Å—è–∫–∏–π —Ä–∞–∑, –∫–æ–≥–¥–∞ –Ω–∞–º –Ω—É–∂–Ω–æ —Ä–∞–±–æ—Ç–∞—Ç—å —Å –Ω–∞—à–∏–º –º–∞—Å—Å–∏–≤–æ–º, –Ω–∞–º –Ω—É–∂–Ω–æ —Ç–æ–ª—å–∫–æ –ø–æ–∑–≤–æ–Ω–∏—Ç—å np.

81% —É—á–∞—Å—Ç–Ω–∏–∫–æ–≤ –∑–∞—è–≤–∏–ª–∏, —á—Ç–æ –ø–æ—Å–ª–µ –ø–æ—Å–µ—â–µ–Ω–∏–µ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è. –ü–æ–ª—É—á–∏—Ç–µ –ø—Ä–∏–≥–ª–∞—à–µ–Ω–∏–µ –Ω–∞ —É—á–µ–±–Ω—ã–π –∫—É—Ä—Å —Å–µ–≥–æ–¥–Ω—è.

–°—Ä–µ–¥–Ω–∏–π –≤—ã–ø—É—Å–∫–Ω–∏–∫ —É—á–µ–±–Ω–æ–≥–æ –∫—É—Ä—Å–∞ –ø–æ—Ç—Ä–∞—Ç–∏–ª –º–µ–Ω–µ–µ —à–µ—Å—Ç–∏ –º–µ—Å—è—Ü–µ–≤ –Ω–∞ –ø–µ—Ä–µ—Ö–æ–¥–Ω—É—é –∫–∞—Ä—å–µ—Ä—É, –æ—Ç –Ω–∞—á–∞–ª–∞ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –¥–æ –ø–æ–∏—Å–∫–∞ —Å–≤–æ–µ–π –ø–µ—Ä–≤–æ–π —Ä–∞–±–æ—Ç—ã.

–î–∞–ª–µ–µ –º—ã –∏–¥–µ–º. —á—Ç–æ–±—ã –æ–±—ä—è–≤–∏—Ç—å –Ω–∞—à –º–∞—Å—Å–∏–≤ —Å –ø–æ–º–æ—â—å—é –∏–Ω—Ç–µ—Ä—Ñ–µ–π—Å–∞ –º–∞—Å—Å–∏–≤–∞:

–ù–∞—à –º–∞—Å—Å–∏–≤ —Å–æ–¥–µ—Ä–∂–∏—Ç —á–µ—Ç—ã—Ä–µ —Å—Ç—Ä–æ–∫–æ–≤—ã—Ö –∑–Ω–∞—á–µ–Ω–∏—è. –ö–∞–∫ –∏ –≤ —Ç—Ä–∞–¥–∏—Ü–∏–æ–Ω–Ω–æ–º –º–∞—Å—Å–∏–≤–µ Python, –º—ã –∑–∞–∫–ª—é—á–∏–ª–∏ –≤—Å–µ —ç–ª–µ–º–µ–Ω—Ç—ã –≤ –Ω–∞—à–µ–º —Å–ø–∏—Å–∫–µ –≤ –∫–≤–∞–¥—Ä–∞—Ç–Ω—ã–µ —Å–∫–æ–±–∫–∏. –ß—Ç–æ–±—ã –æ–±—ä—è–≤–∏—Ç—å –º–∞—Å—Å–∏–≤ NumPy, –º—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–ª–∏ –º–µ—Ç–æ–¥ –º–∞—Å—Å–∏–≤–∞, –∫–æ—Ç–æ—Ä—ã–π —è–≤–ª—è–µ—Ç—Å—è —á–∞—Å—Ç—å—é np. –≠—Ç–æ —Å–æ–∑–¥–∞–µ—Ç –æ–±—ä–µ–∫—Ç ndarray, –∫–æ—Ç–æ—Ä—ã–π —è–≤–ª—è–µ—Ç—Å—è –≤—Å—Ç—Ä–æ–µ–Ω–Ω—ã–º —Ç–∏–ø–æ–º –º–∞—Å—Å–∏–≤–∞ NumPy.

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –∫–æ–ø–∏—é –Ω–∞—à–µ–≥–æ –∏—Å—Ö–æ–¥–Ω–æ–≥–æ –º–∞—Å—Å–∏–≤–∞ –≤ –≤–∏–¥–µ –º–∞—Å—Å–∏–≤–∞ NumPy:

–í–æ—Ç –∏ –≤—Å–µ: —Ç–µ–ø–µ—Ä—å —É –Ω–∞—Å –µ—Å—Ç—å –º–∞—Å—Å–∏–≤, —Å –∫–æ—Ç–æ—Ä—ã–º –º—ã –º–æ–∂–µ–º —Ä–∞–±–æ—Ç–∞—Ç—å.

–ú–∞—Å—Å–∏–≤—ã NumPy: –∏–∑–º–µ—Ä–µ–Ω–∏—è

–ö–æ–≥–¥–∞ –º—ã –≥–æ–≤–æ—Ä–∏–º –æ–± –∏–∑–º–µ—Ä–µ–Ω–∏—è—Ö –≤ NumPy, –º—ã –Ω–µ –∏–º–µ–µ–º –≤ –≤–∏–¥—É –Ω–æ–≤—ã–µ –º–∏—Ä—ã, –∫–æ—Ç–æ—Ä—ã–µ –≤—ã –º–æ–≥–ª–∏ –±—ã —É–≤–∏–¥–µ—Ç—å –≤ —Ñ–∏–ª—å–º–∞—Ö. –ò–∑–º–µ—Ä–µ–Ω–∏–µ –≤ –º–∞—Å—Å–∏–≤–µ - —ç—Ç–æ –æ–¥–∏–Ω —É—Ä–æ–≤–µ–Ω—å –≥–ª—É–±–∏–Ω—ã –≤–Ω—É—Ç—Ä–∏ —ç—Ç–æ—Ç –º–∞—Å—Å–∏–≤. –ö–æ–≥–¥–∞ –∏—Å–ø–æ–ª—å–∑—É–µ—Ç—Å—è —Ç–µ—Ä–º–∏–Ω "–∏–∑–º–µ—Ä–µ–Ω–∏–µ", –æ–Ω –æ—Ç–Ω–æ—Å–∏—Ç—Å—è –∫ –≤–ª–æ–∂–µ–Ω–Ω—ã–º –º–∞—Å—Å–∏–≤–∞–º. –≠—Ç–æ –º–∞—Å—Å–∏–≤—ã, –∫–æ—Ç–æ—Ä—ã–µ —Å–æ–¥–µ—Ä–∂–∞—Ç –º–∞—Å—Å–∏–≤—ã.

–ú–∞—Å—Å–∏–≤ –º–æ–∂–µ—Ç –∏–º–µ—Ç—å –ª—é–±–æ–µ –∫–æ–ª–∏—á–µ—Å—Ç–≤–æ –∏–∑–º–µ—Ä–µ–Ω–∏–π. –ë–æ–ª—å—à–∏–Ω—Å—Ç–≤–æ –º–∞—Å—Å–∏–≤–æ–≤, –∫–æ—Ç–æ—Ä—ã–µ –≤—ã " —Ä–∞–±–æ—Ç–∞—Ç—å —Å 1-D, 2-D –∏–ª–∏ 3-D –º–∞—Å—Å–∏–≤–∞–º–∏. " D " –æ–±–æ–∑–Ω–∞—á–∞–µ—Ç –∏–∑–º–µ—Ä–µ–Ω–∏–µ.

NumPy 1-D Array

–í –Ω–∞—à–µ–º –ø–µ—Ä–≤–æ–º –Ω–∞–ø—Ä–∏–º–µ—Ä, –º—ã —Å–æ–∑–¥–∞–ª–∏ 1-–º–µ—Ä–Ω—ã–π –º–∞—Å—Å–∏–≤. –≠—Ç–æ –º–∞—Å—Å–∏–≤, –∫–æ—Ç–æ—Ä—ã–π —Å–æ–¥–µ—Ä–∂–∏—Ç –º–∞—Å—Å–∏–≤—ã (–∏–ª–∏ —ç–ª–µ–º–µ–Ω—Ç—ã) 0-D –≤ –∫–∞—á–µ—Å—Ç–≤–µ —Å–≤–æ–∏—Ö —ç–ª–µ–º–µ–Ω—Ç–æ–≤. –ë–æ–ª—å—à–∏–Ω—Å—Ç–≤–æ –º–∞—Å—Å–∏–≤–æ–≤, —Å –∫–æ—Ç–æ—Ä—ã–º–∏ –≤—ã –±—É–¥–µ—Ç–µ —Ä–∞–±–æ—Ç–∞—Ç—å, –±—É–¥—É—Ç –æ–¥–Ω–æ–º–µ—Ä–Ω—ã–º–∏.

–î–∞–≤–∞–π—Ç–µ —Å–æ–∑–¥–∞–¥–∏–º –º–∞—Å—Å–∏–≤, –≤ –∫–æ—Ç–æ—Ä–æ–º –±—É–¥—É—Ç —Ö—Ä–∞–Ω–∏—Ç—å—Å—è —Ü–µ–Ω—ã –Ω–∞ —É–≥–æ—â–µ–Ω–∏—è –≤ –∫–æ—Ñ–µ–π–Ω–µ:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –º–∞—Å—Å–∏–≤ –≤ –æ–¥–Ω–æ–º –∏–∑–º–µ—Ä–µ–Ω–∏–∏, –≤ –∫–æ—Ç–æ—Ä–æ–º —Ö—Ä–∞–Ω—è—Ç—Å—è –Ω–∞—à–∏ –∑–Ω–∞—á–µ–Ω–∏—è: [1.95 2. & nbsp; 2.05]. & Nbsp;

–ß—Ç–æ–±—ã –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø –∫ —ç–ª–µ–º–µ–Ω—Ç—É –∏–∑ –æ–¥–Ω–æ–º–µ—Ä–Ω–æ–≥–æ –º–∞—Å—Å–∏–≤–∞, –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ç–æ—Ç –∂–µ —Å–∏–Ω—Ç–∞–∫—Å–∏—Å, —á—Ç–æ –∏ –¥–ª—è —Å–ø–∏—Å–∫–∞ Python. –î–∞–≤–∞–π—Ç–µ –Ω–∞–π–¥–µ–º –≤—Ç–æ—Ä–æ–π —ç–ª–µ–º–µ–Ω—Ç –≤ –Ω–∞—à–µ–º —Å–ø–∏—Å–∫–µ:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —ç–ª–µ–º–µ–Ω—Ç —Å–æ –∑–Ω–∞—á–µ–Ω–∏–µ–º –∏–Ω–¥–µ–∫—Å–∞ 1, –∞ –∏–º–µ–Ω–Ω–æ: 2.

–ß—Ç–æ–±—ã —É–∑–Ω–∞—Ç—å –±–æ–ª—å—à–µ –æ –º–∞—Å—Å–∏–≤–∞—Ö Python, –ø—Ä–æ—á—Ç–∏—Ç–µ –Ω–∞—à —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–æ –ø–æ –º–∞—Å—Å–∏–≤–∞–º Python –¥–ª—è –Ω–∞—á–∏–Ω–∞—é—â–∏—Ö .

–î–≤—É—Ö–º–µ—Ä–Ω—ã–π –º–∞—Å—Å–∏–≤ NumPy

–ù–µ –≤—Å–µ –º–∞—Å—Å–∏–≤—ã —è–≤–ª—è—é—Ç—Å—è –æ–¥–Ω–æ–º–µ—Ä–Ω—ã–º–∏. –ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Ö–æ—Ç–∏–º —Å–æ—Ö—Ä–∞–Ω–∏—Ç—å –º–∞—Å—Å–∏–≤, —Å–æ–¥–µ—Ä–∂–∞—â–∏–π –¥–≤–∞ –º–∞—Å—Å–∏–≤–∞. –í –æ–¥–Ω–æ–º –±–ª–æ–∫–µ —Ö—Ä–∞–Ω—è—Ç—Å—è —Å–ª–∞–¥–æ—Å—Ç–∏, –ø—Ä–æ–¥–∞–≤–∞–µ–º—ã–µ –≤ –∫–æ—Ñ–µ–π–Ω–µ; –¥—Ä—É–≥–æ–π –º–∞—Å—Å–∏–≤ —Ö—Ä–∞–Ω–∏—Ç —Å–ø–∏—Å–æ–∫ –∫–æ—Ñ–µ, –ø—Ä–æ–¥–∞–Ω–Ω—ã—Ö –≤ –º–∞–≥–∞–∑–∏–Ω–µ. –í–º–µ—Å—Ç–µ –æ–Ω–∏ —è–≤–ª—è—é—Ç—Å—è —á–∞—Å—Ç—å—é –º–∞—Å—Å–∏–≤–∞ menu items.

–î–∞–≤–∞–π—Ç–µ —Å–æ–∑–¥–∞–¥–∏–º —ç—Ç–æ—Ç –º–∞—Å—Å–∏–≤ —Å –ø–æ–º–æ—â—å—é NumPy:

–†–µ–∑—É–ª—å—Ç–∏—Ä—É—é—â–∏–π –º–∞—Å—Å–∏–≤:

–ù–∞—à –Ω–µ–¥–∞–≤–Ω–æ —Å–æ–∑–¥–∞–Ω–Ω—ã–π –º–∞—Å—Å–∏–≤ –∏–º–µ–µ—Ç –¥–≤–∞ –∏–∑–º–µ—Ä–µ–Ω–∏—è. –ü–µ—Ä–≤—ã–π –º–∞—Å—Å–∏–≤ –≤ –Ω–∞—à–µ–º –º–∞—Å—Å–∏–≤–µ —Å–æ–¥–µ—Ä–∂–∏—Ç —Å–ø–∏—Å–æ–∫ —Å–ª–∞–¥–∫–∏—Ö —É–≥–æ—â–µ–Ω–∏–π; –≤—Ç–æ—Ä–æ–π –º–∞—Å—Å–∏–≤ —Å–æ–¥–µ—Ä–∂–∏—Ç —Å–ø–∏—Å–æ–∫ –∫–æ—Ñ–µ. –û–±—Ä–∞—Ç–∏—Ç–µ –≤–Ω–∏–º–∞–Ω–∏–µ, —á—Ç–æ –æ–±–∞ —ç—Ç–∏—Ö –º–∞—Å—Å–∏–≤–∞ –∑–∞–∫–ª—é—á–µ–Ω—ã –≤ –ø–∞—Ä—É –∫–≤–∞–¥—Ä–∞—Ç–Ω—ã—Ö —Å–∫–æ–±–æ–∫, —Å–æ–µ–¥–∏–Ω—è—é—â–∏—Ö –¥–≤–∞ –º–∞—Å—Å–∏–≤–∞.

–ü–æ–ª—É—á–µ–Ω–∏–µ —ç–ª–µ–º–µ–Ω—Ç–æ–≤ –∏–∑ –¥–≤—É—Ö–º–µ—Ä–Ω–æ–≥–æ –º–∞—Å—Å–∏–≤–∞ —Ä–∞–±–æ—Ç–∞–µ—Ç –Ω–µ—Å–∫–æ–ª—å–∫–æ –∏–Ω–∞—á–µ –≤ NumPy, —á–µ–º —ç—Ç–æ –¥–µ–ª–∞–µ—Ç –≤ Python. –ß—Ç–æ–±—ã –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø –∫ —ç–ª–µ–º–µ–Ω—Ç–∞–º –∏–∑ –¥–≤—É–º–µ—Ä–Ω–æ–≥–æ –º–∞—Å—Å–∏–≤–∞, –≤–∞–º –Ω–µ–æ–±—Ö–æ–¥–∏–º–æ —Ä–∞–∑–¥–µ–ª–∏—Ç—å –Ω–æ–º–µ—Ä–∞ –∏–Ω–¥–µ–∫—Å–æ–≤ –∑–Ω–∞—á–µ–Ω–∏—è, –∫–æ—Ç–æ—Ä–æ–µ –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø–æ–ª—É—á–∏—Ç—å –∏–∑ –º–∞—Å—Å–∏–≤–∞.

–†–∞—Å—Å–º–æ—Ç—Ä–∏–º —ç—Ç–æ—Ç –∫–æ–¥:

"–ö–∞—Ä—å–µ—Ä–∞ –ö–∞—Ä–º–∞ –≤–æ—à–ª–∞ –≤ –º–æ—é –∂–∏–∑–Ω—å, –∫–æ–≥–¥–∞ —è –±–æ–ª—å—à–µ –≤—Å–µ–≥–æ –≤ –Ω–µ–π –Ω—É–∂–¥–∞–ª–∞—Å—å, –∏ –±—ã—Å—Ç—Ä–æ –ø–æ–º–æ–≥–ª–∞ –º–Ω–µ –ø—Ä–æ–π—Ç–∏ –∫—É—Ä—Å –æ–±—É—á–µ–Ω–∏—è. –ß–µ—Ä–µ–∑ –¥–≤–∞ –º–µ—Å—è—Ü–∞ –ø–æ—Å–ª–µ –æ–∫–æ–Ω—á–∞–Ω–∏—è —É—á–µ–±—ã —è –Ω–∞—à–µ–ª —Ä–∞–±–æ—Ç—É —Å–≤–æ–µ–π –º–µ—á—Ç—ã, –∫–æ—Ç–æ—Ä–∞—è —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤–æ–≤–∞–ª–∞ –º–æ–∏–º —Ü–µ–Ω–Ω–æ—Å—Ç—è–º –∏ —Ü–µ–ª—è–º –≤ –∂–∏–∑–Ω–∏!"

–í–µ–Ω–µ—Ä–∞, –∏–Ω–∂–µ–Ω–µ—Ä-–ø—Ä–æ–≥—Ä–∞–º–º–∏—Å—Ç Rockbot

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç: Jammy Shortbread. –ú—ã –ø–æ–ª—É—á–∏–ª–∏ —ç–ª–µ–º–µ–Ω—Ç —Å–æ –∑–Ω–∞—á–µ–Ω–∏–µ–º –∏–Ω–¥–µ–∫—Å–∞ 2, –∫–æ—Ç–æ—Ä—ã–π —Ö—Ä–∞–Ω–∏—Ç—Å—è –≤–Ω—É—Ç—Ä–∏ –º–∞—Å—Å–∏–≤–∞ —Å–æ –∑–Ω–∞—á–µ–Ω–∏–µ–º –∏–Ω–¥–µ–∫—Å–∞ 0. –í —ç—Ç–æ–º —Å–ª—É—á–∞–µ –º—ã –∏–∑–≤–ª–µ–∫–ª–∏ –ø–æ—Å–ª–µ–¥–Ω–∏–π —ç–ª–µ–º–µ–Ω—Ç –≤ –º–∞—Å—Å–∏–≤–µ, –≤ –∫–æ—Ç–æ—Ä–æ–º —Ö—Ä–∞–Ω—è—Ç—Å—è —Å–ª–∞–¥–æ—Å—Ç–∏, –ø—Ä–æ–¥–∞–≤–∞–µ–º—ã–µ –≤ –∫–∞—Ñ–µ.

–¢—Ä–µ—Ö–º–µ—Ä–Ω—ã–π –º–∞—Å—Å–∏–≤ NumPy

–î–∞–≤–∞–π—Ç–µ –¥–æ–±–∞–≤–∏–º –µ—â–µ –æ–¥–Ω–æ –∏–∑–º–µ—Ä–µ–Ω–∏–µ! –ú–∞—Å—Å–∏–≤—ã NumPy –º–æ–≥—É—Ç —Å–æ–¥–µ—Ä–∂–∞—Ç—å —Ç—Ä–µ—Ö–º–µ—Ä–Ω—ã–µ –º–∞—Å—Å–∏–≤—ã. –≠—Ç–æ –º–∞—Å—Å–∏–≤, —Å–æ–¥–µ—Ä–∂–∞—â–∏–π –¥–≤—É–º–µ—Ä–Ω—ã–µ –º–∞—Å—Å–∏–≤—ã.

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Ö–æ—Ç–∏–º —Å–æ—Ö—Ä–∞–Ω–∏—Ç—å —Å–ª–µ–¥—É—é—â–∏–µ –∑–Ω–∞—á–µ–Ω–∏—è:

  • –°–ª–∞–¥–∫–∞—è –∏ –Ω–µ—Å–ª–∞–¥–∫–∞—è –µ–¥–∞ –ø—Ä–µ–¥–ª–æ–∂–µ–Ω–∏—è (–ø–∞—Ä–Ω—ã–µ, –Ω–æ –æ—Ç–¥–µ–ª—å–Ω—ã–º–∏ –º–∞—Å—Å–∏–≤–∞–º–∏); –∏
  • –Ω–∞–ø–∏—Ç–∫–∏ —Å –∫–æ—Ñ–µ–∏–Ω–æ–º –∏ –±–µ–∑ –∫–æ—Ñ–µ–∏–Ω–∞ (–ø–æ–ø–∞—Ä–Ω–æ, –≤ –æ—Ç–¥–µ–ª—å–Ω—ã—Ö –º–∞—Å—Å–∏–≤–∞—Ö);

–í—Å–µ —ç—Ç–∏ –∑–Ω–∞—á–µ–Ω–∏—è –¥–æ–ª–∂–Ω—ã —Ö—Ä–∞–Ω–∏—Ç—å—Å—è –≤ –æ–¥–Ω–æ–º –º–∞—Å—Å–∏–≤–µ. –†–∞–∑–º–µ—Ä—ã —ç—Ç–æ–≥–æ –º–∞—Å—Å–∏–≤–∞:

  • 1-D: –≤—Å–µ –ø—É–Ω–∫—Ç—ã –º–µ–Ω—é
  • 2-D: —Å–ª–∞–¥–∫–æ–µ –∏ –Ω–µ—Å–ª–∞–¥–∫–æ–µ. –ø—Ä–æ–¥—É–∫—Ç—ã, –∏ –Ω–∞–ø–∏—Ç–∫–∏ –±–µ–∑ –∫–æ—Ñ–µ–∏–Ω–∞
  • 3-D: —Å–ª–∞–¥–∫–∏–µ –ø—Ä–æ–¥—É–∫—Ç—ã, –Ω–µ—Å–ª–∞–¥–∫–∏–µ –ø—Ä–æ–¥—É–∫—Ç—ã, –Ω–∞–ø–∏—Ç–∫–∏ —Å –∫–æ—Ñ–µ–∏–Ω–æ–º –∏ –±–µ–∑ –∫–æ—Ñ–µ–∏–Ω–∞

–î–∞–≤–∞–π—Ç–µ —Å–æ–∑–¥–∞–¥–∏–º —ç—Ç–æ—Ç –º–∞—Å—Å–∏–≤ —Å –ø–æ–º–æ—â—å—é NumPy. –í—Å—Ç–∞–≤—å—Ç–µ —Å–ª–µ–¥—É—é—â–∏–π –∫–æ–¥ –≤ —Ñ–∞–π–ª Python:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

–ú—ã —Å–æ–∑–¥–∞–ª–∏ —Ç—Ä–µ—Ö–º–µ—Ä–Ω—ã–π –º–∞—Å—Å–∏–≤ —Å–æ –≤—Å–µ–π –∏–Ω—Ñ–æ—Ä–º–∞—Ü–∏–µ–π, –∫–æ—Ç–æ—Ä—É—é –º—ã –æ–±—Å—É–∂–¥–∞–ª–∏ —Ä–∞–Ω–µ–µ. –≠—Ç–æ—Ç –º–∞—Å—Å–∏–≤ –ø—Ä–µ–¥—Å—Ç–∞–≤–ª—è–µ—Ç —Å–æ–±–æ–π –ø–æ–ª–Ω—ã–π —Å–ø–∏—Å–æ–∫ –≤—Å–µ—Ö –ø—É–Ω–∫—Ç–æ–≤ –º–µ–Ω—é, –ø—Ä–µ–¥–ª–∞–≥–∞–µ–º—ã—Ö –∫–æ—Ñ–µ–π–Ω–µ–π.

–î–æ—Å—Ç—É–ø –∫ —ç–ª–µ–º–µ–Ω—Ç–∞–º –∏–∑ —Ç—Ä–µ—Ö–º–µ—Ä–Ω–æ–≥–æ –º–∞—Å—Å–∏–≤–∞ —Ä–∞–±–æ—Ç–∞–µ—Ç –∞–Ω–∞–ª–æ–≥–∏—á–Ω–æ —Å–∏–Ω—Ç–∞–∫—Å–∏—Å—É, –∫–æ—Ç–æ—Ä—ã–π –≤—ã –∏—Å–ø–æ–ª—å–∑—É–µ—Ç–µ –¥–ª—è –¥–æ—Å—Ç—É–ø–∞ –∫ —ç–ª–µ–º–µ–Ω—Ç–∞–º –∏–∑ –¥–≤—É—Ö–º–µ—Ä–Ω–æ–≥–æ –º–∞—Å—Å–∏–≤–∞. –†–∞–∑–Ω–∏—Ü–∞ –≤ —Ç–æ–º, —á—Ç–æ –≤–∞–º –Ω—É–∂–Ω–æ —É–∫–∞–∑–∞—Ç—å —Ç—Ä–µ—Ç–∏–π –∏–Ω–¥–µ–∫—Å. —á–∏—Å–ª–æ –¥–ª—è –∏–∑–≤–ª–µ—á–µ–Ω–∏—è —ç–ª–µ–º–µ–Ω—Ç–∞ –∏–∑ —Ç—Ä–µ—Ö–º–µ—Ä–Ω–æ–≥–æ –º–∞—Å—Å–∏–≤–∞. –î–∞–≤–∞–π—Ç–µ –∏–∑–≤–ª–µ—á–µ–º " Mocha " –∏–∑ –Ω–∞—à–µ–≥–æ –º–∞—Å—Å–∏–≤–∞:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç: Mocha.

1 - —ç—Ç–æ –ø–æ—Ä—è–¥–∫–æ–≤—ã–π –Ω–æ–º–µ—Ä 1-–≥–æ –∏–∑–º–µ—Ä–µ–Ω–∏—è, –∫ –∫–æ—Ç–æ—Ä–æ–º—É –º—ã —Ö–æ—Ç–∏–º –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø. (1 —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤—É–µ—Ç –Ω–∞—à–∏–º –Ω–∞–ø–∏—Ç–∫–∞–º); 0 - –ø–æ—Ä—è–¥–∫–æ–≤—ã–π –Ω–æ–º–µ—Ä 2-–≥–æ –∏–∑–º–µ—Ä–µ–Ω–∏—è (0 —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤—É–µ—Ç –Ω–∞–ø–∏—Ç–∫–∞–º —Å –∫–æ—Ñ–µ–∏–Ω–æ–º); 2 - –ø–æ—Ä—è–¥–∫–æ–≤—ã–π –Ω–æ–º–µ—Ä 3-–≥–æ –∏–∑–º–µ—Ä–µ–Ω–∏—è (2 —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤—É–µ—Ç Mocha).

Count —Ä–∞–∑–º–µ—Ä—ã –≤ –º–∞—Å—Å–∏–≤–µ

–ú–∞—Å—Å–∏–≤—ã NumPy –º–æ–≥—É—Ç –Ω–∞—á–∞—Ç—å –≤—ã–≥–ª—è–¥–µ—Ç—å –¥–æ–≤–æ–ª—å–Ω–æ —Å–ª–æ–∂–Ω—ã–º–∏, –∫–æ–≥–¥–∞ –≤—ã –Ω–∞—á–Ω–µ—Ç–µ –¥–æ–±–∞–≤–ª—è—Ç—å –Ω–æ–≤—ã–µ –∏–∑–º–µ—Ä–µ–Ω–∏—è. –£ –Ω–∞—Å –¥–∞–∂–µ –Ω–µ—Ç –æ–ø—ã—Ç–∞ Lored –º–∞—Å—Å–∏–≤—ã, –∫–æ—Ç–æ—Ä—ã–µ –∏–º–µ—é—Ç –±–æ–ª–µ–µ —Ç—Ä–µ—Ö –∏–∑–º–µ—Ä–µ–Ω–∏–π! –ö —Å—á–∞—Å—Ç—å—é –¥–ª—è –≤–∞—Å, —Å—É—â–µ—Å—Ç–≤—É–µ—Ç —É–¥–æ–±–Ω—ã–π —è—Ä–ª—ã–∫, –∫–æ—Ç–æ—Ä—ã–π –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥–ª—è –≤—ã—á–∏—Å–ª–µ–Ω–∏—è –∫–æ–ª–∏—á–µ—Å—Ç–≤–∞ –∏–∑–º–µ—Ä–µ–Ω–∏–π –≤ –º–∞—Å—Å–∏–≤–µ.

–í—Å—Ç–∞–≤—å—Ç–µ —Å–ª–µ–¥—É—é—â–∏–π –∫–æ–¥ –≤ —Ñ–∞–π–ª Python:

–î–∞–≤–∞–π—Ç–µ –∑–∞–ø—É—Å—Ç–∏–º –Ω–∞—à –∫–æ–¥. –ó–Ω–∞—á–µ–Ω–∏–µ " 2 " –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç—Å—è. –≠—Ç–æ –≥–æ–≤–æ—Ä–∏—Ç –Ω–∞–º –æ —Ç–æ–º, —á—Ç–æ –Ω–∞—à –º–∞—Å—Å–∏–≤ —Å–æ–¥–µ—Ä–∂–∏—Ç –¥–≤–∞ –∏–∑–º–µ—Ä–µ–Ω–∏—è, –∏ –º—ã –º–æ–∂–µ–º —É–±–µ–¥–∏—Ç—å—Å—è, —á—Ç–æ —ç—Ç–æ –ø—Ä–∞–≤–¥–∞, –ø—Ä–æ–∞–Ω–∞–ª–∏–∑–∏—Ä–æ–≤–∞–≤ –Ω–∞—à –≤—ã—à–µ—É–ø–æ–º—è–Ω—É—Ç—ã–π –º–∞—Å—Å–∏–≤.

–ó–∞–∫–ª—é—á–µ–Ω–∏–µ

–ú–∞—Å—Å–∏–≤—ã NumPy - —ç—Ç–æ –≥–∏–±–∫–∏–π —Å–ø–æ—Å–æ–± —Ö—Ä–∞–Ω–µ–Ω–∏—è –ø–æ—Ö–æ–∂–∏—Ö –∑–Ω–∞—á–µ–Ω–∏–π. –û–Ω–∏ –±—ã—Å—Ç—Ä–µ–µ –∏ —ç—Ñ—Ñ–µ–∫—Ç–∏–≤–Ω–µ–µ —Ç—Ä–∞–¥–∏—Ü–∏–æ–Ω–Ω—ã—Ö –º–∞—Å—Å–∏–≤–æ–≤ Python. –í—ã –º–æ–∂–µ—Ç–µ –ª–µ–≥–∫–æ —Ä–∞–±–æ—Ç–∞—Ç—å —Å –Ω–µ—Å–∫–æ–ª—å–∫–∏–º–∏ –∏–∑–º–µ—Ä–µ–Ω–∏—è–º–∏, –∏—Å–ø–æ–ª—å–∑—É—è –º–∞—Å—Å–∏–≤—ã NumPy; —ç—Ç–æ —Å–ª–æ–∂–Ω–µ–µ —Å–¥–µ–ª–∞—Ç—å –≤ –æ–±—ã—á–Ω–æ–º Python.

–¢–µ–ø–µ—Ä—å –≤—ã –≥–æ—Ç–æ–≤—ã –Ω–∞—á–∞—Ç—å –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–∞—Å—Å–∏–≤—ã NumPy, –∫–∞–∫ –æ–ø—ã—Ç–Ω—ã–π –ø—Ä–æ–≥—Ä–∞–º–º–∏—Å—Ç!

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

News


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method