Combining 2 data series into one

2017-06-27 Thread Bhaskar Dhariyal
Hi! I have 2 dataframe i.e. df1['first_name'] and df2['last_name']. I want to make it as df['name']. How to do it using pandas dataframe. first_name -- bhaskar Rohit last_name --- dhariyal Gavval should appear as name -- bhaskar dhariyal Rohit Gavval Thanks -- htt

Re: Create a list of dates for same day of week in a year

2017-06-27 Thread waldemar . osuch
> Thoughts or examples? > dateutil.rrule is what you may use e.g. In [38]: from dateutil import rrule In [39]: from datetime import date

Re: Create a list of dates for same day of week in a year

2017-06-27 Thread Sayth Renshaw
> > Is there an obvious method I am missing in creating a list of dates? I want > > to get a list of each Saturday and each Wednesday for the year 2017. > > > > It seems and maybe this is where I am wrong but doesn't the datetime > > library already know the dates if yes is there an easy way to

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Rustom Mody
On Wednesday, June 28, 2017 at 1:04:46 AM UTC+5:30, Marko Rauhamaa wrote: > John Ladasky > > OK, that's cheating a bit, using Numpy. It's a nice little program, > > but it leverages a huge, powerful library. > > What would *not* be cheating? A language without a library would be > dead. One man'

Re: Syntax error for simple script

2017-06-27 Thread Chris Angelico
On Wed, Jun 28, 2017 at 12:46 PM, Steve D'Aprano wrote: > I think that there are broadly two sets of newbies in the world: > > - those who will read the message, and be able to resolve the problem from the > current wording ("oh, it needs parentheses, like a function"); > > - and those who won't,

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Chris Angelico
On Wed, Jun 28, 2017 at 12:28 PM, Steve D'Aprano wrote: > E.g. comparing Python to AcmeScript, where you write: > > > program myprogram > begin program > load library webbrowser > new string url copied from 'http://www.example.com' > with webbrowser > begin > method = open > method.call

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Ian Kelly
On Tuesday, June 27, 2017, Steve D'Aprano wrote: > On Wed, 28 Jun 2017 02:23 am, Sam Chats wrote: > > > > https://medium.com/technology-invention-and-more/how-to- > build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 > > > The derivative of the sigmoid curve given is completely w

Re: Create a list of dates for same day of week in a year

2017-06-27 Thread Chris Angelico
On Wed, Jun 28, 2017 at 12:48 PM, Sayth Renshaw wrote: > Is there an obvious method I am missing in creating a list of dates? I want > to get a list of each Saturday and each Wednesday for the year 2017. > > It seems and maybe this is where I am wrong but doesn't the datetime library > already k

Create a list of dates for same day of week in a year

2017-06-27 Thread Sayth Renshaw
Afternoon Is there an obvious method I am missing in creating a list of dates? I want to get a list of each Saturday and each Wednesday for the year 2017. It seems and maybe this is where I am wrong but doesn't the datetime library already know the dates if yes is there an easy way to query it?

Re: Syntax error for simple script

2017-06-27 Thread Steve D'Aprano
On Wed, 28 Jun 2017 05:38 am, Erik wrote: [...] > So I don't understand the resistance to making the error be a bit more > explicit about why it is being generated to help those users - it > doesn't explain (the obvious reason) _why_ their tutorial/example gives > them an error when it doesn't to

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Steve D'Aprano
On Wed, 28 Jun 2017 06:22 am, Marko Rauhamaa wrote: > You saw the APL example, right? APL's standard runtime/library contains > most of Numpy functionality because that's what APL has been designed > for. > > Is that cheating? Of course not. That demonstrates beautifully (or perhaps "unreadably

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Steve D'Aprano
On Wed, 28 Jun 2017 05:34 am, Marko Rauhamaa wrote: > John Ladasky : >> OK, that's cheating a bit, using Numpy. It's a nice little program, >> but it leverages a huge, powerful library. > > What would *not* be cheating? A language without a library would be > dead. Its not really nine lines of P

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Steve D'Aprano
On Wed, 28 Jun 2017 06:19 am, Marko Rauhamaa wrote: > alister : > >> On Tue, 27 Jun 2017 22:34:18 +0300, Marko Rauhamaa wrote: >> >>> John Ladasky : OK, that's cheating a bit, using Numpy. It's a nice little program, but it leverages a huge, powerful library. >>> >>> What would *not* b

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Steve D'Aprano
On Wed, 28 Jun 2017 02:23 am, Sam Chats wrote: > https://medium.com/technology-invention-and-more/how-to-build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 The derivative of the sigmoid curve given is completely wrong. def __sigmoid(self, x): return 1 / (1 + exp(-x

Re: A million requests per second with Python

2017-06-27 Thread YOUR_NAME_HERE
Awesome! I love Python! -- https://mail.python.org/mailman/listinfo/python-list

Check A million requests per second with Python

2017-06-27 Thread YOUR_NAME_HERE
Awesome! Python's becoming more of an all rounder! -- https://mail.python.org/mailman/listinfo/python-list

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Chris Angelico
On Wed, Jun 28, 2017 at 6:22 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Wed, Jun 28, 2017 at 5:34 AM, Marko Rauhamaa wrote: >>> What would *not* be cheating? A language without a library would be >>> dead. >> >> Sure, but there are different levels of cheating. Using a >> general-purpos

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Marko Rauhamaa
Chris Angelico : > On Wed, Jun 28, 2017 at 5:34 AM, Marko Rauhamaa wrote: >> What would *not* be cheating? A language without a library would be >> dead. > > Sure, but there are different levels of cheating. Using a > general-purpose programming language and its standard library isn't > usually c

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Marko Rauhamaa
alister : > On Tue, 27 Jun 2017 22:34:18 +0300, Marko Rauhamaa wrote: > >> John Ladasky : >>> OK, that's cheating a bit, using Numpy. It's a nice little program, >>> but it leverages a huge, powerful library. >> >> What would *not* be cheating? A language without a library would be >> dead. > > t

Re: how to write add frequency in particular file by reading a csv file and then making a new file of multiple csv file by adding frequency

2017-06-27 Thread Jerry Hill
On Fri, Jun 23, 2017 at 4:07 PM, Mark Byrne wrote: > Possible fix is to replace this: > > count = frequency.get(word,0) > count1 = frequency.get(word1,0) > if word1 == word: > frequency[word] = count + count1 > else: > frequency[word] = count > > with this: > > if word1 == word: > if

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Chris Angelico
On Wed, Jun 28, 2017 at 5:34 AM, Marko Rauhamaa wrote: > John Ladasky : >> OK, that's cheating a bit, using Numpy. It's a nice little program, >> but it leverages a huge, powerful library. > > What would *not* be cheating? A language without a library would be > dead. Sure, but there are differen

Re: how to write add frequency in particular file by reading a csv file and then making a new file of multiple csv file by adding frequency

2017-06-27 Thread SANS SANTOSH
On Sat 24. Jun 2017 at 13:27, Mark Byrne wrote: > A problem (possibly the problem) is the lines which use the get function: > count = frequency.get(word,0) > > Since the dictionary is empty at the start of the loop, the get function is > passing a value of 0 to count and count1. > The subsequent

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread alister
On Tue, 27 Jun 2017 22:34:18 +0300, Marko Rauhamaa wrote: > John Ladasky : >> OK, that's cheating a bit, using Numpy. It's a nice little program, >> but it leverages a huge, powerful library. > > What would *not* be cheating? A language without a library would be > dead. > > > Marko true but f

Re: Syntax error for simple script

2017-06-27 Thread Erik
On 27/06/17 15:05, Steve D'Aprano wrote: On Tue, 27 Jun 2017 08:34 am, Erik wrote about the print function error message: To be fair, this already seems to be a special case: [...] >>> len "bar" File "", line 1 len "bar" ^ SyntaxError: invalid syntax Correct, the pr

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread John Ladasky
On Tuesday, June 27, 2017 at 9:24:07 AM UTC-7, Sam Chats wrote: > https://medium.com/technology-invention-and-more/how-to-build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 OK, that's cheating a bit, using Numpy. It's a nice little program, but it leverages a huge, powerful lib

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Marko Rauhamaa
John Ladasky : > OK, that's cheating a bit, using Numpy. It's a nice little program, > but it leverages a huge, powerful library. What would *not* be cheating? A language without a library would be dead. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: argparse epilog call function?

2017-06-27 Thread breamoreboy
On Tuesday, June 27, 2017 at 3:25:10 PM UTC+1, Chris Angelico wrote: > On Wed, Jun 28, 2017 at 12:09 AM, Fox wrote: > > what " -h " are you even talkin bout ? > > > > > > > > > > def Examples(): > > text = """Lots of examples""" > > print(text.format()) > > > > > > > > epilog='where the h

Re: A Good Tutorial on Python Decorators

2017-06-27 Thread Paul Barry
Me doing the decorator thing (from a web dev point-of-view) at PyCon Ireland 2015: https://www.youtube.com/watch?v=My2UpCaN7rE and here's a link to the PDF of my talk's material: http://paulbarry.itcarlow.ie/pyconie2015/decorators.pdf Paul. On 27 June 2017 at 17:43, Andre Müller wrote: >

Re: How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Marko Rauhamaa
Sam Chats : > https://medium.com/technology-invention-and-more/how-to-build-a-simpl > e-neural-network-in-9-lines-of-python-code-cc8f23647ca1 Impressive, but APL's got Python beat. This one-liner implements the Game of Life: life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵} https://en.wikipedia.o

Re: Syntax error for simple script

2017-06-27 Thread boB Stepp
On Tue, Jun 27, 2017 at 9:05 AM, Steve D'Aprano wrote: > On Tue, 27 Jun 2017 08:34 am, Erik wrote about the print function error > message: > > py> print x > File "", line 1 > print x > ^ > SyntaxError: Missing parentheses in call to 'print' [snip] >> I think the suggestion abov

Re: A Good Tutorial on Python Decorators

2017-06-27 Thread Andre Müller
Activate JavaScript, then you can see the content. I had the same problem. Peter Pearson schrieb am Di., 27. Juni 2017 um 18:35 Uhr: > On Tue, 27 Jun 2017 15:10:53 + (UTC), Saurabh Chaturvedi wrote: > > https://opensource.google.com/projects/py-decorators-tutorial > > "No Results found." > >

Re: A Good Tutorial on Python Decorators

2017-06-27 Thread Peter Pearson
On Tue, 27 Jun 2017 15:10:53 + (UTC), Saurabh Chaturvedi wrote: > https://opensource.google.com/projects/py-decorators-tutorial "No Results found." -- To email me, substitute nowhere->runbox, invalid->com. -- https://mail.python.org/mailman/listinfo/python-list

How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Sam Chats
https://medium.com/technology-invention-and-more/how-to-build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 -- https://mail.python.org/mailman/listinfo/python-list

Re: argparse epilog call function?

2017-06-27 Thread Didymus
On Tuesday, June 27, 2017 at 11:47:42 AM UTC-4, Didymus wrote: > On Tuesday, June 27, 2017 at 9:56:13 AM UTC-4, Didymus wrote: > > Greetings, > > > > I might be barking up the wrong tree, but was wondering if there's a way to > > have the argpasre epilog call a function. for example: > > > > epi

Re: argparse epilog call function?

2017-06-27 Thread Didymus
On Tuesday, June 27, 2017 at 9:56:13 AM UTC-4, Didymus wrote: > Greetings, > > I might be barking up the wrong tree, but was wondering if there's a way to > have the argpasre epilog call a function. for example: > > epilog=Examples() > > Where Examples is: > > def Examples(): > text = """L

Re: argparse epilog call function?

2017-06-27 Thread Peter Otten
Didymus wrote: > Greetings, > > I might be barking up the wrong tree, but was wondering if there's a way > to have the argpasre epilog call a function. for example: > > epilog=Examples() > > Where Examples is: > > def Examples(): > text = """Lots of examples""" > print(text.format()) >

A million requests per second with Python

2017-06-27 Thread Sam Chats
https://medium.freecodecamp.com/million-requests-per-second-with-python-95c137af319 -- https://mail.python.org/mailman/listinfo/python-list

A Good Tutorial on Python Decorators

2017-06-27 Thread Saurabh Chaturvedi
https://opensource.google.com/projects/py-decorators-tutorial -- https://mail.python.org/mailman/listinfo/python-list

Re: "Python launcher" required to run *.py scripts on Windows?

2017-06-27 Thread eryk sun
On Tue, Jun 27, 2017 at 5:41 AM, Ben S. via Python-list wrote: > > When I always call Python script from CommandPrompt like > > D:\tools\Python\python.exe mypythonscript.py > > then this Launcher should not be necessary. The launcher implements shebang support for directly running Python scripts

Re: argparse epilog call function?

2017-06-27 Thread Chris Angelico
On Wed, Jun 28, 2017 at 12:09 AM, Fox wrote: > what " -h " are you even talkin bout ? > > > > > def Examples(): > text = """Lots of examples""" > print(text.format()) > > > > epilog='where the heck to put a -h ?? ' > > epilog=Examples() List admins, this person has been abusing the p

Re: argparse epilog call function?

2017-06-27 Thread Fox
what " -h " are you even talkin bout ? def Examples(): text = """Lots of examples""" print(text.format()) epilog='where the heck to put a -h ?? ' epilog=Examples() -- https://mail.python.org/mailman/listinfo/python-list

Re: argparse epilog call function?

2017-06-27 Thread Chris Angelico
On Tue, Jun 27, 2017 at 11:55 PM, Didymus wrote: > Greetings, > > I might be barking up the wrong tree, but was wondering if there's a way to > have the argpasre epilog call a function. for example: > > epilog=Examples() > > Where Examples is: > > def Examples(): > text = """Lots of examples"

Re: Syntax error for simple script

2017-06-27 Thread Steve D'Aprano
On Tue, 27 Jun 2017 08:34 am, Erik wrote about the print function error message: py> print x File "", line 1 print x ^ SyntaxError: Missing parentheses in call to 'print' > To be fair, this already seems to be a special case: [...] > >>> len "bar" >File "", line 1 > len

argparse epilog call function?

2017-06-27 Thread Didymus
Greetings, I might be barking up the wrong tree, but was wondering if there's a way to have the argpasre epilog call a function. for example: epilog=Examples() Where Examples is: def Examples(): text = """Lots of examples""" print(text.format()) I've place this in and found that it pr

Re: Converting sentences to vector form

2017-06-27 Thread Bhaskar Dhariyal
You can't train a model on words. You need to convert it into numerical form(vector form). For this there are some packages like word2vec and doc2vec. Thanks for replying On Tuesday, 27 June 2017 16:37:56 UTC+5:30, Ben Bacarisse wrote: > Bhaskar Dhariyal writes: > > > I am doing a project

Re: Converting sentences to vector form

2017-06-27 Thread Ben Bacarisse
Bhaskar Dhariyal writes: > I am doing a project on data science. I need to convert sentences to > vectorial form. That's not a term I am familiar with. If it's standard, that's my fault, but you can still help people like me by explaining what you mean. And if it is not a standard term then pe

Converting sentences to vector form

2017-06-27 Thread Bhaskar Dhariyal
Hi, I am doing a project on data science. I need to convert sentences to vectorial form. I have already written code for cleansing data and already removed stop words and performed stemming. Please help in converting kickdesc and kickkey to vectorial form. Link to code and dataset: https://dr

Re: "Python launcher" required to run *.py scripts on Windows?

2017-06-27 Thread Andre Müller
Double Post: https://python-forum.io/Thread-Python-launcher-required-to-run-py-scripts-on-Windows Pleas don't do this. It's not a nice behavior. Thanks. Andre -- https://mail.python.org/mailman/listinfo/python-list

Re: "Python launcher" required to run *.py scripts on Windows?

2017-06-27 Thread Ned Batchelder
On Tuesday, June 27, 2017 at 1:41:22 AM UTC-4, Ben S. wrote: > As I observed v3.6.1 installs (on Windows 7) in addition to the core python > engine a second program "Python Launcher". > > As far as I read this component seems to be not necessary since it only aims > to facilitate the handling wi

Re: Syntax error for simple script

2017-06-27 Thread Steve D'Aprano
On Tue, 27 Jun 2017 03:00 am, mm0fmf wrote: > Sorry to victim blame but why can't people copy the error message into a > search engine, such as Google, and see what the problem is themselves? You're not victim blaming. There's no *victim* here, syntax errors are a part of programming and one has

Re: "Python launcher" required to run *.py scripts on Windows?

2017-06-27 Thread Terry Reedy
On 6/27/2017 1:41 AM, Ben S. via Python-list wrote: As I observed v3.6.1 installs (on Windows 7) in addition to the core python engine a second program "Python Launcher". As far as I read this component seems to be not necessary since it only aims to facilitate the handling with *.py scripts o