-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython Code.py
More file actions
44 lines (41 loc) · 1.13 KB
/
Python Code.py
File metadata and controls
44 lines (41 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> import pandas as pd
...
... import sqlalchemy as sal
...
... df = pd.read_csv('netflix_titles.csv')
...
... engine = sal.create_engine('mssql://LAPTOP-57QR538I\SQLEXPRESS/master?driver=ODBC+DRIVER+17+FOR+SQL+SERVER')
... conn= engine.connect()
...
... df.to_sql('netflix', con = conn, index = False, if_exists = 'append')
... conn.close()
...
... len(df)
...
... df[df.show_id == 's5023']
...
... max(df.show_id.dropna().str.len())
...
... max(df.type.dropna().str.len())
...
... max(df.title.dropna().str.len())
...
... max(df.director.dropna().str.len())
...
... max(df.cast.dropna().str.len())
...
... max(df.country.dropna().str.len())
...
... max(df.date_added.dropna().str.len())
...
... max(df.release_year.dropna().str.len())
...
... max(df.rating.dropna().str.len())
...
... max(df.duration.dropna().str.len())
...
max(df.listed_in.dropna().str.len())
max(df.description.dropna().str.len())
df.isna().sum()