<jupyter_start><jupyter_text>`Cannabis (drug)`  `INFORMATION`: Everything we need to know about marijuana (cannabis)>`Cannabis, also known as marijuana among other names, is a psychoactive drug from the Cannabis plant used for medical or recreational purposes. The main psychoactive part of cannabis is tetrahydrocannabinol (THC), one of 483 known compounds in the plant, including at least 65 other cannabinoids. Cannabis can be used by smoking, vaporizing, within food, or as an extract`>[For more information](https://www.medicalnewstoday.com/articles/246392.php)[VIDEO](https://youtu.be/GhTYI3DeNgA) ![](https://cdn.shopify.com/s/files/1/0975/1130/files/GLPlantInfo_58b4c4d0-eda7-4fc3-97ed-1319ca431e62.jpg?v=1525710776)<jupyter_code>import pandas as pd
import missingno
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("dark")
import warnings
warnings.simplefilter("ignore")
import numpy as np
df = pd.read_csv("cannabis.csv");df.head()<jupyter_output><empty_output><jupyter_text>`Understainding attributes`>| Attribute Name  | Info                                         || --------------  | -------------------------------------------- || Strain Name     | Given Name of strain                         || Type            | type of Strain(namly indica, sativa, hybrid) || rating          | User Rating                                  || Effects         | Different effects optained                   || Description     | other backround info                         |  UNDERSTAING DATA like finding null values<jupyter_code>df.shape#showing (row , columns)
df.info()#geting basic information like datatypes 
#we can clearly see there are some missing values in Flavor and Description
missingno.matrix(df);
df.isnull().sum()#see null values
print(df.Type.value_counts())#counting the occurence of values
sns.categorical.countplot(df.Type);#displaying it through graph
plt.ylabel("distribuition")
sns.distplot(df.Rating);
#by this we can see that all the types have rating more than 3.5
#finding max rating to each type
df.groupby(["Type"])["Rating"].max()
#finding min rating to each type
df.groupby(["Type"])["Rating"].min()
#mean rating
df.groupby(["Type"])["Rating"].mean()
#Now we will extract the values in Effects and Flavor and pass to a new column
effect = pd.DataFrame(df.Effects.str.split(',',4).tolist(),
             columns = ['Eone','Etwo','Ethree','Efour','Efive'])

flavors = pd.DataFrame(df.Flavor.str.split(',',n=2,expand=True).values.tolist(),
                          columns = ['Fone','Ftwo','Fthree'])
df = pd.concat([df, effect], axis=1)
df = pd.concat([df, flavors], axis=1)#concating the two dataframes
#for more information plz visit
#link => http://pandas.pydata.org/pandas-docs/stable/merging.html
df.columns
#finding top 5 effects
print(df.Eone.value_counts().head())
plt.figure(figsize=(15,10))
sns.boxplot(x = "Eone",y = "Rating",hue="Type",data=df[df.Rating > 3.5]);
#finding top 5 Flavor
df.Eone.value_counts().head()
plt.figure(figsize=(15,10))
plt.xticks(rotation=90)
sns.countplot(x = "Fone",data=df);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14705882352941177, 'fraction_numerical': 0.02262443438914027, 'mean_word_length': 3.732415902140673, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '11517', 'license': 'MIT', 'n_tokens_mistral': 1040, 'n_tokens_neox': 956, 'n_words': 256, 'path': 'DataScience365/Day 9/EDA Cannabis.ipynb', 'repo_name': 'HiteshGorana/DataScience365', 'size': '3094'}