This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pandas استيراد مكتبة | |
import pandas as pd | |
file_path = 'data/Employees.csv' # csv مسار ملف | |
data_employees =pd.read_csv(file_path) # سحب البيانات وتخزينها في إطار بيانات | |
data_employees.head() # التأكد من إطار البيانات الجديد |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pandas استيراد مكتبة | |
import pandas as pd | |
file_path = 'data/Employees.txt' # tsv مسار ملف | |
data_employees = pd.read_csv(file_path, sep='\t') # سحب البيانات وتخزينها في إطار بيانات | |
data_employees.head() # التأكد من إطار البيانات الجديد |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# إلى قيم مفصولة بمفتاح المسافة delim_whitespace يشير المعامل | |
data = pd.read_csv(filepath, delim_whitespace=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# إلى عدم استخدام الصف الأول كـ أسماء للأعمدة header يشير المعامل | |
data = pd.read_csv(filepath, header=None) | |
# names يتم وضع أسماء مخصصة للأعمدة من خلال المعامل | |
data = pd.read_csv(filepath, names=['Names', 'Age', 'Job']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filepath = 'data/Fruits.json' # JSON مسار ملف | |
df_Fruits = pd.read_json(filepath) # سحب البيانات وتخزينها في إطار بيانات | |
df_Fruits.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SQL Data Imports | |
import sqlite3 as sq3 | |
import pandas as pd | |
path = 'data/sample.db' # SQLite db مسار ملف قاعدة البيانات | |
con = sq3.Connection(path) # تهيئة اتصال مع قاعدة البيانات | |
query = ''' SELECT * FROM 'Employee'; ''' # SQL استعلام |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#استيراد المكتبات | |
import pandas as pd | |
from pymongo import MongoClient | |
con = MongoClient() # تهيئة الاتصال | |
# con.list_database_names() # استعراض قواعد البيانات المتاحدة لديك | |
db = con.database_name # الاتصال بقاعدة البيانات المطلوبة | |
cursor = db.collection_name.find(query) # تحضير المؤشر بواسطةالاستعلام |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
data_url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/heart-disease/processed.switzerland.data' # رابط البيانات | |
df = pd.read_csv(data_url, header=None) | |
df.head() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# استيراد المكتبات | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
import seaborn as sns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# مسار الملف | |
file_path = 'data/StudentsPerformance.csv' | |
# سحب البيانات وتحويلها إلى إطار بيانات | |
df = pd.read_csv(file_path) | |
# استعراض أول 10 صفوف | |
df.head(10) |
OlderNewer