This file contains hidden or 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
| /* | |
| * Scroll-based animations | |
| */ | |
| @supports (animation-timeline: view()) { ... } | |
| @media (prefers-reduced-motion: no-preference) { ... } | |
| @keyframes appear { | |
| from { | |
| opacity: 0; |
This file contains hidden or 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
| -- Example with a table called "roles" | |
| -- Get the sequence name | |
| select pg_get_serial_sequence('roles', 'role_id'); | |
| -- Result: roles_role_id_seq | |
| -- Set the new value | |
| select setval('roles_role_id_seq', <NEW_VALUE>, true); |
This file contains hidden or 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
| def morph_columns(df: DataFrame, char: str = '_') -> DataFrame: | |
| """ Standardize and remove spaces of column names of a given dataframe | |
| """ | |
| def mapper(item: str) -> str: | |
| """ Set item to lowercase and replace spaces with desired character | |
| """ | |
| if ' ' in item: | |
| return item.replace(' ', char).lower() |
This file contains hidden or 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
| """ Note: | |
| Why not just use .drop_duplicates()? | |
| Well, there is a known issue with that method increasing memory usage | |
| """ | |
| def clean_dataframe(df: DataFrame) -> DataFrame: | |
| """ Removes duplicate and null rows and returns the resulting dataframe | |
| """ | |
| duplicate_rows = df[df.duplicated()] | |
| indices = [row[0] for row in duplicate_rows.itertuples()] |
This file contains hidden or 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
| <html> | |
| <head> | |
| <title>Semantic Structure</title> | |
| </head> | |
| <body> | |