<jupyter_start><jupyter_text><jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns #to get piechat
import plotly.graph_objects as go
import plotly.express as px
import warnings
warnings.filterwarnings("ignore")
df = pd.read_csv('amazon.csv' , encoding = 'latin1')
df
df.info()
print(df.dtypes)
print(df.columns)
print(df.shape) # to print row nd columns
df.columns
df.state.value_counts() # to check the number of repeated rows
print(set(df['state'].values)) #  to get the names of distinct rows.
print(set(df['month'].values))

df_forest_fire_by_year = df.groupby(['year']).number.agg(sum)
df_forest_fire_by_year =pd.DataFrame(df_forest_fire_by_year)#it will table form 
df_forest_fire_by_year.number = df_forest_fire_by_year.number.map(lambda p: round(p)) #for graph plotting.
df_forest_fire_by_year.plot(ylabel='Total fires by year', figsize=(10,5))#setting for graph size
df_forest_fire_by_year.T #by this u can view graphs nd table

sns.set(rc={'figure.figsize':(15,10)}) #figure size setting
my_circle=plt.Circle( (0,0), 0.7, color='white') # coordinates of centre of pie chart,nd to get radius in white space
plt.pie(df['state'].value_counts().values, labels = df['state'].value_counts().index)
p=plt.gcf() #to get current fig
p.gca().add_artist(my_circle)# to get different color to chat
plt.show()
sns.set(rc={'figure.figsize':(15,10)}) #figure size setting
my_circle=plt.Circle( (0,0), 0.7, color='white') # coordinates of centre of pie chart,nd to get radius in white space
plt.pie(df['month'].value_counts().values, labels = df['month'].value_counts().index)
p=plt.gcf() #to get current fig
p.gca().add_artist(my_circle)# to get different color to chat
plt.show()
fig = px.pie(values=df['state'].value_counts().values, names=df['state'].value_counts().index,title='Cities involving forest fires')
fig.show()
fig = px.pie(values=df['month'].value_counts().values, names=df['month'].value_counts().index,title='months involving forest fires')
fig.show()
fig = px.scatter(df, x="year", y="month",size='number') #to get scatter graph
fig.show()
fig = px.scatter(df, x="year", y="month",size='number')
fig.show()
bar = sns.barplot(df['state'], df['number'], color = "red")
bar.set_xticklabels(df['state'], rotation=45)
df = df.groupby('state')['number'].mean().reset_index() #for calculating mean
print(df)<jupyter_output>state      number
0               Acre   77.255356
1            Alagoas   19.350000
2              Amapa   91.345506
3           Amazonas  128.243218
4              Bahia  187.222703
5              Ceara  127.314071
6   Distrito Federal   14.899582
7     Espirito Santo   27.389121
8              Goias  157.721841
9           Maranhao  105.142808
10       <NAME>  201.351523
11      Minas Gerais  156.800243
12           Paraiba  109.698573
13              Pará  102.561272
14        Pernambuco  102.502092
15              Piau  158.174674
16               Rio   62.985865
17          Rondonia   84.876272
18           Roraima  102.029598
19    Santa Catarina  101.924067
20         Sao Paulo  213.896226
21           Sergipe   13.543933
22         Tocantins  141.037176
{'fraction_non_alphanumeric': 0.12769278801123946, 'fraction_numerical': 0.08023727755229472, 'mean_word_length': 3.6569767441860463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '513656', 'license': 'Apache-2.0', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1142, 'n_words': 283, 'path': 'Data_Analysis_Amazon_Forest.ipynb', 'repo_name': 'anjali0503/Exploratory-Data-Analysis', 'size': '3208'}