セクション 2. 章 2
single
Removing and Replacing
メニューを表示するにはスワイプしてください
As mentioned previously, there are two ways to perform removing or replacing operations. Since we used the .str accessor two chapters ago, let's use a lambda function this time.
タスク
スワイプしてコーディングを開始
-
Define a lambda function with a single argument
xthat will:-
Remove the
'$'characters starting from the left (using the.lstrip()method); -
Replace all blank spaces (
' ') with empty strings ('') (using the.replace()method); -
Assign the function to the
rmv_rplvariable.
-
-
Apply the
rmv_rplfunction to the'Weekly_Sales'column using the.apply()method and convert it to thefloatdata type.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 2. 章 2
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください