myCompiler myCompiler
Deutsch English Español Français Italiano 日本語 한국어 Nederlands Polski Português
Recent
Login Sign up
Recent
Login Sign up
D

@danbihan

Forward fill NaNs

Python
4 years ago
import pandas as pd import numpy as np clients = { 'client_id' : [1001, 1001, 1001, 1002, 1002, 1002, 1003, 1003], 'ranking' : [1, 2, 3, 1, 2, 3, 1, 2], 'value': [1000, np.nan, 1200, 1500, 1250, np.nan, 1100, np.nan] } clients_df = pd.

Stemming

Python
4 years ago
roots = ["cat", "bat", "rat", "kempt"] sentence = "the unkempt cattle was rattled by the battery" def replace_words(roots, sentence): words_list = sentence.split(' ') # Create a dictionary of words that can be stemmed stemming_dict = {

One element removed

Python
4 years ago
list_x = [1,2,3,4,5] list_y = [1,2,4,5] def one_element_removed(list_x, list_y): difference = sum(list_x) - sum(list_y) return difference print(one_element_removed(list_x, list_y))

Stop words

Python
4 years ago
stopwords = [ 'I', 'as', 'to', 'you', 'your', 'but', 'be', 'a', ]

Stock profit

Python
5 years ago
stock_prices = [10,5,20,32,25,12] dts = [ '2019-01-01', '2019-01-02', '2019-01-03', '2019-01-04', '2019-01-05', '2019-01-06', ]

Bigrams

Python
5 years ago
sentence = """ Have free hours and love children? Drive kids to school, soccer practice and other activities. """ def get_bigrams(sentence): words = sentence.split(' ') words = [word.replace('\n', '').lower() for word in words]
Previous Next page

Supported languages

Deno JavaScript NodeJS Python Ruby Go C C++ Java C# TypeScript PHP Bash R Octave (MATLAB) Fortran Lua Erlang SQL MySQL MongoDB Clojure D Perl Kotlin Swift Rust Assembly
© 2026 mycompiler.io
Terms of service Privacy policy Contact us