Polars DataFrame परिचय

Polars परिचय

Liam Brannigan

Data Scientist and Polars Contributor

अपने इंस्ट्रक्टर से मिलें

$$

  • Liam Brannigan, Lead Data Scientist
  • ML और Data Engineering विशेषज्ञ
  • Polars योगदानकर्ता

इंस्ट्रक्टर की प्रोफाइल तस्वीर.

Polars परिचय

टैबुलर डेटा

shape: (49, 8)
| name        | type    | price | bedrooms | doubles | singles | review | beach |
| ---         | ---     | ---   | ---      | ---     | ---     | ---    | ---   |
| str         | str     | i64   | i64      | i64     | i64     | f64    | bool  |
|-------------|---------|-------|----------|---------|---------|--------|-------|
| Waves       | Cottage | 540   | 4        | 1       | 2       | 8.9    | false |
| Seashells   | Cottage | 540   | 4        | 2       | 2       | 8.7    | true  |
| Lake view   | Cottage | 714   | 3        | 1       | 4       | 9.2    | true  |
| Piran View  | null    | 775   | null     | 1       | 3       | 9.6    | false |
| Palma Villa | Cottage | 1772  | 4        | 1       | 2       | 9.6    | true  |
Polars परिचय

बर्फ में चलता ध्रुवीय भालू और जंगल में पांडा की साथ-साथ छवियाँ.

  • Polars आमतौर पर Pandas से तेज होता है → parallel computation
  • Polars का lazy mode ऑप्टिमाइज़्ड क्वेरी सक्षम करता है
Polars परिचय

Apache Arrow और Rust के लोगो.

  • Apache Arrow: टैबुलर डेटा मेमोरी में स्टोर करता है
  • Rust: डेटा प्रोसेसिंग के लिए तेज भाषा
Polars परिचय

डेटा लोडिंग दिखाने के लिए डेटाबेस की रूपरेखा.

  • डेटा लोड करना और जाँचना
Polars परिचय

रूपांतरण दिखाने के लिए डेटाबेस और गियर्स की रूपरेखा.

  • डेटा लोड करना और जाँचना
  • डेटा ट्रांसफॉर्म करना और ऑप्टिमाइज़ेशन
Polars परिचय

विश्लेषण दिखाने के लिए डेटाबेस, गियर्स और चार्ट की रूपरेखा.

  • डेटा लोड करना और जाँचना
  • डेटा ट्रांसफॉर्म करना और ऑप्टिमाइज़ेशन
  • डेटा का विश्लेषण
Polars परिचय

CSV पढ़ना

import polars as pl


rentals = pl.read_csv("vacation_rentals.csv")
Polars परिचय

DataFrame की शुरुआती पंक्तियाँ

rentals.head(3)

rentals DataFrame की शुरुआती पंक्तियाँ.

Polars परिचय

DataFrame की शुरुआती पंक्तियाँ

rentals.head(3)

shape हाइलाइट किए हुए rentals DataFrame.

Polars परिचय

DataFrame की शुरुआती पंक्तियाँ

rentals.head(3)

पहला कॉलम हाइलाइट किए हुए rentals DataFrame.

  • dtype: किसी कॉलम में डेटा का टाइप
Polars परिचय

DataFrame की शुरुआती पंक्तियाँ

rentals.head(3)

rentals कॉलम हाइलाइट किए हुए rentals DataFrame.

Polars परिचय

DataFrame की आखिरी पंक्तियाँ

rentals.tail()
shape: (5, 8)
| name                | type      | price | bedrooms | doubles | singles | review | beach |
| ---                 | ---       | ---   | ---      | ---     | ---     | ---    | ---   |
| str                 | str       | i64   | i64      | i64     | i64     | f64    | bool  |
|---------------------|-----------|-------|----------|---------|---------|--------|-------|
| Hengar Manor House  | Cottage   | 615   | 4        | 1       | 5       | 9.4    | false |
| Tudor Cottage Hayle | Cottage   | 489   | 3        | 2       | 3       | 8.9    | false |
| Tolcarne Apartments | Apartment | 1764  | 3        | 1       | 4       | 9.3    | true  |
| Tolcarne Apartments | Apartment | 1605  | 3        | 1       | 4       | 9.3    | true  |
| Tehidy Holiday Park | Cottage   | 637   | 4        | 2       | 4       | 9.0    | false |
Polars परिचय

DataFrame मेटाडाटा

rentals.shape
(49, 8)
rentals.columns
['name', 'type', 'price', 'bedrooms', 'doubles', 'singles', 'review', 'beach']
Polars परिचय

DataFrame स्कीमा

rentals.schema
Schema([('name', String),
        ('type', String),
        ('price', Int64),
        ('bedrooms', Int64),
        ('doubles', Int64),
        ('singles', Int64),
        ('review', Float64),
        ('beach', Boolean)])
Polars परिचय

DataFrame निरीक्षण

rentals.glimpse()
Rows: 49
Columns: 8
$ name      <str> 'Waves', 'Seashells', 'Lake view', 'Piran View',...
$ type      <str> 'Cottage', 'Cottage', 'Cottage', None, 'Cottage',...
$ price     <i64> 540, 540, 714, 775, 1772, 934, 1947, 1026, 705, 863
$ bedrooms  <i64> 4, 4, 3, None, 4, 3, 4, 3, 4, 3
$ doubles   <i64> 1, 2, 1, 1, 1, 1, 1, 1, 1, 1
$ singles   <i64> 2, 2, 4, 3, 2, 4, 2, 4, 2, 2
$ review    <f64> 8.9, 8.7, 9.2, 9.6, 9.6, 8.6, 9.6, 8.6, 9.7, 9.1
$ beach    <bool> False, True, True, False, True, True, True, True, True, True
Polars परिचय

अभ्यास करते हैं!

Polars परिचय

Preparing Video For Download...