Hello,
I have the following piece of code. In this, I wanted to make use
of the optional parameter given to 'a', i.e- '5', and not '1'
def fun_varargs(a=5, *numbers, **dict):
print("Value of a is",a)
for i in numbers:
print("Value of i is",i)
for i, j in dict.items()
On 29/12/2018 06:12, Karthik Bhat wrote:
> def fun_varargs(a=5, *numbers, **dict):
> print("Value of a is",a)
>
> for i in numbers:
> print("Value of i is",i)
>
> for i, j in dict.items():
> print("The value of i and j are:",i,j)
>
> fun_varargs(1,2,3,4,5,6,7,8,9,10,
On Sat, Dec 29, 2018 at 11:42:16AM +0530, Karthik Bhat wrote:
> Hello,
>
> I have the following piece of code. In this, I wanted to make use
> of the optional parameter given to 'a', i.e- '5', and not '1'
>
> def fun_varargs(a=5, *numbers, **dict):
[...]
>
> fun_varargs(1,2,3,4,5,6,7,8,9
Steven,
As I head out the door, I will sketch it.
Given a data.frame populated with N rows and columns you want to break it
into training and test data sets.
In a data.frame, you can refer to a row by using an index like 5 or 2019.
You can ask for the number of rows currently in existence. You c
Karthik Bhat wrote:
> Hello,
>
> I have the following piece of code. In this, I wanted to make use
> of the optional parameter given to 'a', i.e- '5', and not '1'
>
> def fun_varargs(a=5, *numbers, **dict):
> print("Value of a is",a)
>
> for i in numbers:
> print("Value
Steven,
A more practical answer about splitting a data frame is to import modules such
as for machine learning.
Import sklearn.model_selection
Then use train_test_split() to return 4 parts. Not sure what answers you need
and why here. Plenty of ways and tools exist to specify choosing percen
I have my usual off the wall answer.
OK, seriously. Not exactly an answer but perhaps an experiment.
The question was how to have a non-named first argument to a function with
some form of default.
As was pointed out, this does not fit well with being able to have python
gather all positional a