Tampilkan postingan dengan label office. Tampilkan semua postingan
Tampilkan postingan dengan label office. Tampilkan semua postingan

Rabu, 11 Mei 2022

Airflow Cron

Spark Submit
spark-submit --master local[4] /home/repl/spark-script.py

# Create the DAG object
dag = DAG(dag_id="car_factory_simulation",
default_args={"owner": "airflow","start_date": airflow.utils.dates.days_ago(2)},
schedule_interval="0 * * * *")

Fetch API
import requests

# Fetch the Hackernews post
resp = requests.get("https://hacker-news.firebaseio.com/v0/item/16222426.json")

# Print the response parsed as JSON
print(resp.json())

# Assign the score of the test to post_score
post_score = resp.json()["score"]
print(post_score)


Result
{'by': 'neis', 'descendants': 0, 'id': 16222426, 'score': 17, 'time': 1516800333, 'title': 'Duolingo-Style Learning for Data Science: DataCamp for Mobile', 'type': 'story', 'url': 'https://medium.com/datacamp/duolingo-style-learning-for-data-science-datacamp-for-mobile-3861d1bc02df'} 17

ETL Extract Transform Load

  • Complete the transform_avg_rating() function by grouping by the course_id column, and taking the mean of the rating column.
  • Use extract_rating_data() to extract raw ratings data. It takes in as argument the database engine db_engines.
  • Use transform_avg_rating() on the raw rating data you've extracted.
  • Mencari kesamaan antar user 1 2 3 berdasarkan rating yang di input di sistem

Now that you have a grasp of what's happening in the datacamp_application database, let's go ahead and write up a query for that database.

The goal is to get a feeling for the data in this exercise. You'll get the rating data for three sample users and then use a predefined helper function, print_user_comparison(), to compare the sets of course ids these users rated.

  • Complete the connection URI. The database is called datacamp_application. The host is localhost with port 5432. The username is repl and the password is password.
  • Select the ratings of users with id: 438718163 and 8770.
  • Fill in print_user_comparison() with the three users you selected.

# Complete the connection URI

connection_uri = "postgresql://repl:password@localhost:5432/datacamp_application" 
db_engine = sqlalchemy.create_engine(connection_uri)

# Get user with id 4387
user1 = pd.read_sql("SELECT * FROM rating WHERE user_id=4387", db_engine)

# Get user with id 18163
user2 = pd.read_sql("SELECT * FROM rating WHERE user_id=18163", db_engine)

# Get user with id 8770
user3 = pd.read_sql("SELECT * FROM rating WHERE user_id=8770", db_engine)

# Use the helper function to compare the 3 users
print_user_comparison(user1, user2, user3)


Course id overlap between users:

================================ User 1 and User 2 overlap: {32, 96, 36, 6, 7, 44, 95} User 1 and User 3 overlap: set() User 2 and User 3 overlap: set()


Mencari Average Rating

In this exercise, you'll complete a transformation function transform_avg_rating() that aggregates the rating data using the pandas DataFrame's .groupby() method. The goal is to get a DataFrame with two columns, a course id and its average rating:

course_idavg_rating
1234.72
1114.62

In this exercise, you'll complete this transformation function, and apply it on raw rating data extracted via the helper function extract_rating_data() which extracts course ratings from the rating table.


  • Complete the transform_avg_rating() function by grouping by the course_id column, and taking the mean of the rating column.
  • Use extract_rating_data() to extract raw ratings data. It takes in as argument the database engine db_engines.
  • Use transform_avg_rating() on the raw rating data you've extracted

# Complete the transformation function
def transform_avg_rating(rating_data):
    # Group by course_id and extract average rating per course
    avg_rating = rating_data.groupby('course_id').rating.mean()
    # Return sorted average ratings per course
    sort_rating = avg_rating.sort_values(ascending=False).reset_index()
    return sort_rating

# Extract the rating data into a DataFrame    
rating_data = extract_rating_data(db_engines)

# Use transform_avg_rating on the extracted data and print results
avg_rating_data = transform_avg_rating(rating_data)
print(avg_rating_data) 

course_id rating 0 46 4.800000 1 23 4.800000 2 96 4.692765 3 56 4.661765 4 24 4.653061 .. ... ... 94 54 4.238095 95 92 4.222222 96 29 4.208333 97 17 4.147059 98 42 4.107570



Selasa, 15 Januari 2019

Pakai SO-DIMM RAM DDR3L Low Voltage 1.35V di Slot 1.5V Laptop ASUS A43SA

02-Jan-2019

Kebetulan habis upgrade RAM Laptop Acer Z3-451(tahun produksi 2016-2017) ke DDR3L 8GB, karena slot RAM nya bawaannya pelit cuma ada 1 satu slot, terpaksa RAM DDR3L lamanya yang berkapasitas 4GB di lepas, tidak bisa sekedar tambah satu keping lagi.



Nganggur lah itu RAM 4GB DDR3L (Low Voltage 1.35Volt).

Dari awal saya memang sudah notice slot RAM Laptop saya yang lain, yaitu; ASUS A43SA (tahun produksi 2011) ada 2 Slot RAM 1.5Volt, kebetulan kedua slot sudah di pasang RAM 2GB, jadi total kapasitas RAM bawaan 4GB.

Cari-cari info,

apakah kompatibel RAM kode L (low voltage 1.35V) dipasang di slot 1.5V

dari hasil pengumpulan informasi, ada yang bilang bisa, ada juga yang bilang bisa diawal, di jangka panjang akan blue screen.

Daripada penasaran saya coba saja, RAM bawaan ASUS A43SA yang DDR3 2x2GB 1.5Volt saya lepas satu keping, dan saya pasang RAM DDR3 4GB Low Voltage 1.35Volt, warisan dari Acer Z3-451. 

Kamis, 22 Maret 2018

Cara memunculkan nama lengkap di PDF comment

Sering ga sih pas kalian kerja, dokumen PDF kalian di distribute ke banyak orang, dan dapat comment digital. Sayangnya identitas yang komen cuma inisial atau badge number, kayak MLX857 atau ICE194701.

Trus aku kudu klarifikasi ke mana ini?, sopo sing komen?, ora jelas.

Sebelumnya kita apresiasi dulu kantor anda yang sudah menjalankan paperless, ga kayak kantor primitif yang hobinya nge print kertas mulu, trus berakhir jadi sampah atau bungkus gorengan. Wew blueprint desain jadi kertas gorengan.

Ok step nya adalah
1. Buka PDF, klik comment, klik commenting preferences



Selasa, 21 Oktober 2014

Penggunaan Sticky notes di windows 7

Sticky notes, daripada pake sticky notes hardcopy trus di tempel di layar monitor lebih baik pake sticky notes softcopy yang sudah di sediakan oleh windows 7, cara nya mudah.

Simak step-step nya di bawah

Rabu, 30 April 2014

Auto page number in excel file (Even if you start the page number at page 4)

5 easy step to make auto page number in excel file

1. Group the tab for eazier work (not doing it one by one)


Vlookup Function di Excel (Cara Search Dokumen Revisi di Excel)

Problem:
Cek satu satu, revisi number dokumen yang di list di spek (word document), dengan cara melihat dari list dokumen status di excel
Cara sederhana nya ya di find satu-satu, tapi makin lama makin capek, dan terkadang terjadi kesalahan paralaks.

Solve
Menggunakan vlookup function, agak jelimet, tapi benar benar menghemat waktu looo


Step step nya
1. Copy list document yang akan di search


Ad

Related Posts Plugin for WordPress, Blogger...

Label

Do it Yourself (39) soluna (30) GoPro (28) Motorcycle (27) Roda4 (23) Jual (20) nouvo (19) Travelling (17) jupiter (13) Sepeda (11) mutasi (10) King (8) office (7) vw (6) Dad (5) Jasa (3) Atoz (2) gokart (1)