-
Replied To a Post in lamda expression to match beginning of line with any digit
Got this to work: import string lambda line: line if line[0] in string.digits else None -
Replied To a Post in lamda expression to match beginning of line with any digit
Still working this thru. The reason for lambda is that it will be part of a pyspark filter statement, i.e. `RDD2 = RDD1.filter(lambda line: "take line only if it starts … -
Edited lamda expression to match beginning of line with any digit
I'm trying to design a lambda function that returns any line in a file that begins with any digit [0-9]. The point would be to return the whole line if … -
Created lamda expression to match beginning of line with any digit
I'm trying to design a lambda function that returns any line in a file that begins with any digit [0-9]. The point would be to return the whole line if … -
Created pyspark
Does anyone on the forum have any experience with pyspark (Python API for Apache Spark) -
Replied To a Post in input list being modified in error
It shouold throw an error in that instance -
Replied To a Post in XML file searching
What line is causing the error. Perhaps you could post the error message? It sounds like one of your el.find statements is coming up empty (None) and that's causing the … -
Replied To a Post in input list being modified in error
Vegaseat, I'd never heard of deque before. Must study. Thanks -
Replied To a Post in input list being modified in error
Grub, thanks, but it only needs to shift the supplied list_in, no need for an infinite sequence -
Marked Solved Status for input list being modified in error
I've written this function to take a list and shift each member right by the number supplied as the offset. I want to preserve the supplied list and return the … -
Replied To a Post in input list being modified in error
Thanks pyTony, I made two changes: line 6 changed to `work = list_in[:]` lin 17 changed to `hold = list_in[-offset:]` And now all is well. Valuable lesson there. Thanks Grib, … -
Began Watching input list being modified in error
I've written this function to take a list and shift each member right by the number supplied as the offset. I want to preserve the supplied list and return the … -
Edited input list being modified in error
I've written this function to take a list and shift each member right by the number supplied as the offset. I want to preserve the supplied list and return the … -
Created input list being modified in error
I've written this function to take a list and shift each member right by the number supplied as the offset. I want to preserve the supplied list and return the … -
Replied To a Post in Python script FTP_TSL times out, but Filezilla client works
I did, but it never connects. After modifying the script to: from ftplib import FTP_TLS import ftplib ftps = FTP_TLS() ftps.connect(host="xxx.xx.xxx.xx", port=990) ftps.login(user="myuname", passwd="mypwd") ftps.prot_p() ftps.set_pasv(False) ftps.retrlines('LIST') ftps.quit() It still … -
Began Watching Python script FTP_TSL times out, but Filezilla client works
Using Python 3.3.0 and this script: from ftplib import FTP_TLS ftps = FTP_TLS('xxx.xx.xxx.xx') ftps.sendcmd('USER myuname') ftps.sendcmd('PASS mypwd') ftps.prot_p() ftps.retrlines('LIST') ftps.quit() I get a connection failure due to timeout >>> ================================ … -
Created Python script FTP_TSL times out, but Filezilla client works
Using Python 3.3.0 and this script: from ftplib import FTP_TLS ftps = FTP_TLS('xxx.xx.xxx.xx') ftps.sendcmd('USER myuname') ftps.sendcmd('PASS mypwd') ftps.prot_p() ftps.retrlines('LIST') ftps.quit() I get a connection failure due to timeout >>> ================================ …