Cleaning up conditionals

Deborah Swanson python at deborahswanson.net
Sun Jan 1 21:30:03 EST 2017


Dennis Lee Bieber wrote, on Sunday, January 01, 2017 6:07 PM
> 
> On Sun, 1 Jan 2017 15:50:25 -0800, "Deborah Swanson" 
> <python at deborahswanson.net> declaimed the following:
> 
> >Maybe it would help if I give a couple rows of (made up) 
> data to show 
> >what I mean (first row is field titles):
> >
> >......Description		Date		State/co	Kind
> >Notes
> >l1	2 br, Elk Plains	12-26		WA/pi		house
> >garage, w/d
> >l2	2 br, Elk Plains	12-29
> >
> >In this case, I want to copy the values from l1 to l2.
> >
> >Or I could have, say, if I didn't see the one on 12-26 until after
> >12-29: 
> >l1	2 br, Elk Plains	12-26		
> >l2	2 br, Elk Plains	12-29		WA/pi		house
> >garage, w/d
> >
> >In this case, I want to copy the values from l2 to l1.
> >
> 
> 	And what happens if the data (where ever you get it 
> from to be in one
> file) looks like
> 
> l1	2 br, Elk Plains	12-26		WA/pi
> l2	2 br, Elk Plains	12-29				
> 	house garage, w/d
> 
> 	As I understand your logic, you intend to make the two 
> entries identical EXCEPT for the DATE. What purpose does this 
> duplication serve? Or, put another way -- why is preserving 
> distinctive dates important while everything else is subject 
> to being blended.

Yes, that's exactly what I'm doing in this bit of code, making all the
listings that are identical except for the date be identical except for
the date. You may or may not have tried this approach to finding the
ideal house, but this is my third house hunt, using essentially the same
approach, but in a different language each time. (Python is by far the
best version. A dictionary with city names as keys, and several data
items as values has literally cut the task in half.) 

The usefulness of keeping track of these duplicate listings is history
of the rental being offered. In a real estate market that's on fire like
we have here in the Pacific NW, any house that's relisted more than a
couple times has something wrong with it or it would have been snatched
up, or it's way out in the boonies. In any event, if I do decide to look
at it, my bargaining position is improved by knowing that they've been
trying to rent it for a long friggin time. When I find a new one that
looks promising, I may reject it if I see that it's been on the market a
long time (and I have another bit of code that tells me that instantly).
You can design your project any way you want to!
 
> 	I still get this feeling you should have master file, 
> regardless of whether fields are empty, and treat subsequent 
> data as updates to the master file -- not as some confusing 
> single file with some sort of duplicate contents.
> -- 
> 	Wulfraed                 Dennis Lee Bieber         AF6VN
>     wlfraed at ix.netcom.com    HTTP://wlfraed.home.netcom.com/

You're certainly entitled to your opinion, but my method is time-tested
for my purposes.




More information about the Python-list mailing list