# 5.1 Series आणि DataFrame

Source: https://ravindrabagale.com/mr/datascience/ch05-pandas-dataframes-and-series/5-1-series-and-dataframe.html
Language: mr (Marathi with English technical terms)

Series म्हणजे index असलेला एक column. DataFrame म्हणजे index नुसार जुळलेल्या Series ची table. आधी amount ची छोटी Series करूया आणि मग orders चा DataFrame पाहू.

import pandas as pd

s = pd.Series([64, 90, 240], index=["BLK-001", "BLK-002", "BLK-003"], name="amount")
print(s)
print(s.mean())

df = pd.DataFrame({
    "order_id": ["BLK-260314-001", "BLK-260314-002", "AMN-260314-004"],
    "city": ["Pune", "Nashik", "Kolhapur"],
    "product": ["Gokul Cow Milk 500 ml", "Nashik Grapes 500 g", "Amul Butter 100 g"],
    "qty": [2, 1, 1],
    "amount": [64, 90, 58],
    "status": ["Delivered", "Delivered", "Cancelled"],
    "customer": ["Ruhi Bagale", "Amir", "Zoya"],
})
df

s.mean() Series ची सरासरी देते. DataFrame मध्ये प्रत्येक key हे column चं नाव आणि त्याची list त्या column च्या values आहेत.

रवींद्र बागले यांची tip

सर्व columns मध्ये rows ची संख्या सारखी ठेवा. Sample मधली product नावं आणि identifiers जसे आहेत तसेच वापरा.
