Tag: r

52 votes
6 answers
2.9K views
How do I use $scope.$watch and $scope.$apply in AngularJS?

I don't understand how to use $scope.$watch and $scope.$apply. The official documentation isn't help

avatar
Omar
0 1 0 9
asked 07 September, 2021
58 votes
19 answers
2.2K views
How do I access the $scope variable in browser's console using AngularJS?

I would like to access my $scope variable in Chrome's JavaScript console. How do I do that? I can neithe

avatar
Joseph
0 1 0 9
asked 07 September, 2021
57 votes
14 answers
1.5K views
How does data binding work in AngularJS?

How does data binding work in the AngularJS framework? I haven't found technical details on their site.

avatar
Clarice
0 1 0 9
asked 07 September, 2021
66 votes
30 answers
2.8K views
AngularJS: Service vs provider vs factory

What are the differences between a Service, Provider and Factory in AngularJS?

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
55 votes
11 answers
1.5K views
Why is "1000000000000000 in range(1000000000000001)" so fast in Python 3?

It is my understanding that the range() function, which is actually an object type in Python 3, generates its

avatar
Elicia
0 1 0 9
asked 07 September, 2021
57 votes
29 answers
1.6K views
How do I parse a string to a float or int?

In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 545.2222? Or par

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
52 votes
15 answers
3.1K views
How to access environment variable values

I set an environment variable that I want to access in my Python application. How do I get its value?

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
520 views
How to print colored text to the terminal?

How can I output colored text to the terminal in Python?

avatar
Hallie
0 1 0 9
asked 07 September, 2021
60 votes
22 answers
2.4K views
How do you change the size of figures drawn with Matplotlib?

How do you change the size of figure drawn with Matplotlib?

avatar
Keith
0 1 0 9
asked 07 September, 2021
55 votes
13 answers
584 views
How to delete a file or folder in Python?

How do I delete a file or folder in Python?

avatar
Boyd
0 1 0 9
asked 07 September, 2021
53 votes
11 answers
1.3K views
How do I select rows from a DataFrame based on column values?

How can I select rows from a DataFrame based on values in some column in Pandas? In SQL, I would use: SELECT *

avatar
Freida
0 1 0 9
asked 07 September, 2021
58 votes
16 answers
532 views
55 votes
23 answers
892 views
What does ** (double star/asterisk) and * (star/asterisk) do for parameters?

In the following method definitions, what does the * and ** do for param2? def foo(param1, *param2): def bar(

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
65 votes
7 answers
1.7K views
Understanding Python super() with __init__() methods

I'm trying to understand the use of super(). From the looks of it, both child classes can be created,

avatar
Nidia
0 1 0 9
asked 07 September, 2021
52 votes
22 answers
1.7K views
List changes unexpectedly after assignment. Why is this and how can I prevent it?

While using new_list = my_list, any modifications to new_list changes my_list every time. Why is this, and how

avatar
Elicia
0 1 0 9
asked 07 September, 2021
67 votes
17 answers
846 views
How to make function decorators and chain them together?

How can I make two decorators in Python that would do the following? @makebold @makeitalic def say(): retu

avatar
Shanita
0 1 0 9
asked 07 September, 2021
54 votes
29 answers
2.8K views
How to iterate over rows in a DataFrame in Pandas

I have a DataFrame from Pandas: import pandas as pd inp = [{'c1':10, 'c2':100}, {'c1

avatar
Frederick
0 1 0 9
asked 07 September, 2021
54 votes
30 answers
1.6K views
"Least Astonishment" and the Mutable Default Argument

Anyone tinkering with Python long enough has been bitten (or torn to pieces) by the following issue: def foo(a

avatar
Chaya
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
1.4K views
How do I pass a variable by reference?

The Python documentation seems unclear about whether parameters are passed by reference or value, and the foll

avatar
Gigi
0 1 0 9
asked 07 September, 2021
60 votes
21 answers
520 views
Convert bytes to a string

I'm using this code to get standard output from an external program: >>> from subprocess import

avatar
Keith
0 1 0 9
asked 07 September, 2021