12. Exploratory Data Analysis (EDA)
12.3 Crosstab and Correlation Caution
pd.crosstab(df["city"], df["festival"], values=df["amount"], aggfunc="sum", fill_value=0)
# Numeric association (not causation!):
df[["amount", "delivery_mins"]].corr()
Ravindra Bagale's Tip
A strong value from corr() does not prove that a bigger amount causes more delivery minutes. A third factor, like festival rush, can push both up at the same time. corr() uses the Pearson method by default, which only measures a straight-line link, so write your finding carefully, for example "in this sample, bigger orders tend to take longer".
Ravindra Bagale's Tip – मराठी
corr() मधून मोठी value आली म्हणजे मोठ्या amount मुळेच delivery minutes वाढतात असं सिद्ध होत नाही. Festival ची गर्दी सारखा एखादा तिसरा घटक दोन्ही एकाच वेळी वाढवू शकतो. corr() default ने Pearson पद्धत वापरतो, जी फक्त सरळ रेषेतला संबंध मोजते, म्हणून finding काळजीपूर्वक लिहा, उदाहरणार्थ "या sample मध्ये मोठ्या orders ला जास्त वेळ लागताना दिसतो".
Ravindra Bagale's Tip – हिंदी
corr() से बड़ी value आने का मतलब यह साबित नहीं होता कि बड़े amount की वजह से delivery minutes बढ़ते हैं। Festival की भीड़ जैसा कोई तीसरा कारण दोनों को एक साथ बढ़ा सकता है। corr() default में Pearson तरीका इस्तेमाल करता है, जो सिर्फ़ सीधी रेखा वाला संबंध मापता है, इसलिए अपनी finding सावधानी से लिखो, जैसे "इस sample में बड़े orders में ज़्यादा समय लगता दिखता है"।