<jupyter_start><jupyter_text>Name:<NAME> Email: <EMAIL> -Data Science Camp-(Exploratory analysis of student data) The aims of the project is to find out the Female students who are from Kuwait who raise thier hands more than 50 times and compare that between the Male students who are also from Kuwait who raise thier hands more than 50 timesv to comes in conclusion who is better in interactive in the class " Female or Male).  i built the data science model in python ,I have tried several of the modelswhich are covered during the course,<jupyter_code>%matplotlib inline
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
pwd<jupyter_output><empty_output><jupyter_text>1- I used the function read_csv to read the data form panda liberry.<jupyter_code>df = pd.read_csv("xAPI-Edu-Data.csv")<jupyter_output><empty_output><jupyter_text>2- I used the function describe to performs quick statistical operations on the properties of the data stored in the data frame.<jupyter_code>df.describe()<jupyter_output><empty_output><jupyter_text>3-We can specify all properties regardless of their type by using the include operator to take the value all, in this case the operations will be executed according to the nature of each property, which cannot be executed will result in NaN (like the arithmetic mean we can't perform on a property of text type)<jupyter_code>df.describe(include='all')<jupyter_output><empty_output><jupyter_text>4-We can use the info function which returns a brief information about the data frame.<jupyter_code>df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 480 entries, 0 to 479
Data columns (total 17 columns):
 #   Column                    Non-Null Count  Dtype 
---  ------                    --------------  ----- 
 0   gender                    480 non-null    object
 1   NationalITy               480 non-null    object
 2   PlaceofBirth              480 non-null    object
 3   StageID                   480 non-null    object
 4   GradeID                   480 non-null    object
 5   SectionID                 480 non-null    object
 6   Topic                     480 non-null    object
 7   Semester                  480 non-null    object
 8   Relation                  480 non-null    object
 9   raisedhands               480 non-null    int64 
 10  VisITedResources          480 non-null    int64 
 11  AnnouncementsView         480 non-null    int64 
 12  Discussion                480 non-null    int64 
 13  ParentAnsweringSurvey     480 non-null    object
 14  ParentschoolSatisfaction  [...]<jupyter_text>5-The previous result of the info function contains information about our data structure, in terms of the number of records, the number of columns, the type of each column and the number of values ​​in it as well as the amount of memory consumed for the data frame.To find out the dimensions of the data frame we are dealing with directly, we use the shape property  We have 480 records (rows) of data and 17 columns.<jupyter_code>df.shape<jupyter_output><empty_output><jupyter_text>6-We will often need to see sample data. It is possible to get a random sample using the sample function and specify the number of values ​​you want. In addition, we can get the first/last records in the data frame using the head and tail functions respectively.<jupyter_code>df.sample(10)

df.head()
df.tail()<jupyter_output><empty_output><jupyter_text>7-To ensure that our data frame does not contain null values ​​we use the isnull function of the data frame in the following way.<jupyter_code>df.isnull().values.any()<jupyter_output><empty_output><jupyter_text>8-The previous result means that there is no null value for any property in the data, and if there is a null value, the result will be True.To do some statistical operations directly on a property, it is possible to use the functions of the Numpy library such as mean, max, min, std and others as in the following example<jupyter_code>print(np.mean(df.raisedhands))
print(np.max(df.raisedhands))
print(np.min(df.raisedhands))
print(np.std(df.raisedhands))<jupyter_output>46.775
100
0
30.74714417632964<jupyter_text>9-It is very important while dealing with data to perform some query operations according to the conditions and parameters we want. For example, if we want to query the number of male and female students in the data, we use the value_counts function, which collects the values ​​of a particular column and determines the number of iterations according to each group.<jupyter_code>df["gender"].value_counts()<jupyter_output><empty_output><jupyter_text>10-To query records in a dataframe under certain conditions, the Pandas library introduces the query function of the dataframe, a function that makes it easy for you to perform queries with parameters and conditions.in my case ,I want to inquire about the Male and Female students from the State of Kuwait who have raised the hand more than 50 times in the class and so that we display the gender property and the number of times the hand was raised only,I use the query function in the following way.<jupyter_code>df.query("gender == 'F' and Topic == 'IT' and raisedhands > 50" )[["gender","raisedhands"]]

df.query("gender == 'M' and Topic == 'IT' and raisedhands > 50" )[["gender","raisedhands"]]<jupyter_output><empty_output><jupyter_text>( in conclusion i found out the Male studnts are interact more in the class more than Female students from Kuwait) 11-In many experiments, we need to obtain a graphical figure showing the number of recurrences of records for a particular property (nominal or ordinal) according to the range of values ​​it contains. The Seaborn library provides a countplot function that does this. For example, if we want to know the numbers of students by nationalities, we do the following.<jupyter_code>fig = sns.countplot(x="NationalITy", data=df, palette="muted");
fig.set_xticklabels( fig.get_xticklabels() ,  rotation=70)
plt.show()<jupyter_output><empty_output><jupyter_text>12-I call the countplot function and we pass it first the column we want to count based on its value which is in our case NationalITy and then we select the data frame we are working on, and finally choose the color set of the shape. The function set_xticklabels we use to rotate (70 degrees) the names of nationalities so that they do not overlap between them and the figure appears in an ordered manner.Through the previous graph, and a quick look at it, we get information that most of the students are from Kuwait and Jordan. The following example shows how to do the same for the student's score property<jupyter_code>fig = sns.countplot(x="Class", data=df, palette="muted");
plt.show()<jupyter_output><empty_output><jupyter_text>I notice from the figure that most of the students got an average grade of M in the subjects in general, and the number of students who got a high grade of H is slightly more than the students who got a low grade of L. 13-Displaying the numbers of students by subjects with the breakdown of numbers by degree We pass the hue parameter countplot function and specify the name of the degree property as follows<jupyter_code>plt.subplots(figsize=(13,10))
fig = sns.countplot(x="Topic", data=df, palette="Set2",hue="Class");
fig.set_xticklabels( fig.get_xticklabels() ,  rotation=70)
plt.show()<jupyter_output><empty_output><jupyter_text>14-The graphs may sometimes be not detailed, so we can use the so-called swarm shapes so that each point that represents a record in the data is plotted as:<jupyter_code>Raised_hand = sns.swarmplot(x="Class", y="raisedhands", data=df,  palette="muted")
plt.show()<jupyter_output>C:\Users\Admin\anaconda3\lib\site-packages\seaborn\categorical.py:1296: UserWarning: 11.0% of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.
  warnings.warn(msg, UserWarning)
C:\Users\Admin\anaconda3\lib\site-packages\seaborn\categorical.py:1296: UserWarning: 8.5% of the points cannot be placed; you may want to decrease the size of the markers or use stripplot.
  warnings.warn(msg, UserWarning)<jupyter_text>15-From the previous figure, it is clear to us that most of the students who raised their hand in class more than 60 times got a high grade of H, while most of the students who got a low grade L did not raise their hand more than 20 times in class, while the students who got an average grade were distributed Hand raise times they have on the property area.The Seaborn library provides another function called joinplot to plot a graph showing the relationship of two variables to each other.<jupyter_code>fig = sns.jointplot(x="raisedhands", y="VisITedResources", data=df, kind="reg", size=6);
plt.show()
df.isna()
df.dropna()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06610631531122217, 'fraction_numerical': 0.019650159018627895, 'mean_word_length': 4.294648226097414, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 67, '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': '16', 'dir': 'jupyter-structured-clean-dedup', 'id': '626111', 'license': 'MIT', 'n_tokens_mistral': 2572, 'n_tokens_neox': 2381, 'n_words': 1139, 'path': 'khaloudd-DS-project.ipynb', 'repo_name': 'Khaloud4/DSProject1', 'size': '8827'}