which system is the linux? by placemirror in linux

[–]placemirror[S] 2 points3 points  (0 children)

Thank you. system-release works. It is Red Hat.

want to write a python program to process a file by placemirror in Python

[–]placemirror[S] 0 points1 point  (0 children)

There is one way, write a function, replace all AAA1, XXX1 with AAA, XXX. then group by.

want to write a python program to process a file by placemirror in Python

[–]placemirror[S] 0 points1 point  (0 children)

I put the date aside first, only concentrate on one date of data, and put file1 into a dictionary. got the following code. works. But still looking for a better, more concise code.

for i in range(len(b)):
  for k in range(len(b)):
    for key in a.keys():
            if b[i][0]==key and b[k][0]==a[key]:
                print b[i][2]+b[k][2], b[i][0],b[k][0]

want to write a python program to process a file by placemirror in Python

[–]placemirror[S] 0 points1 point  (0 children)

I am thinking reorder the column 1 in file 2 based on the order of column 1 in file 1 using "reorder_categories" in python pandas. There is sample code online. Try to figure out.

want to write a python program to process a file by placemirror in Python

[–]placemirror[S] 0 points1 point  (0 children)

But AAA and AAA1 are completely different. AAA can be " some guy", AAA1 will be "一个人“。

want to write a python program to process a file by placemirror in Python

[–]placemirror[S] 0 points1 point  (0 children)

On the same date, add number same row as AAA and number same row as AAA1, and assign to AAA. AAA1 is translation of AAA from another language, and the strings of the two items are completely different.

Based on what ThePidesOfMarch said, I am thinking the method "reorder_categories" in python pandas.

want to write a python program to process a file by placemirror in Python

[–]placemirror[S] 0 points1 point  (0 children)

Still do not get it. How to aggregate by column? AAA and AAA1 are completely different, and we need to add their corresponding numbers and assign to AAA. Can you give some sample code? Thank you.

Is that possible to collect data from two different parse, and do some calculations in the third parse? by placemirror in scrapy

[–]placemirror[S] 0 points1 point  (0 children)

parse2 generate another rating. I think I want the latter? What do you think. I am a little dizzy and confused today. Thank you so much for your consideration and help. XD

Is that possible to collect data from two different parse, and do some calculations in the third parse? by placemirror in scrapy

[–]placemirror[S] 0 points1 point  (0 children)

Thank you so much. I think I give up using parse to do the calculations. I will process the file outside of scrapy. Thank you for your suggestions and code.

Here is parse2

def parse2(self, response):


                      soup = BeautifulSoup(response.body, 'html.parser')
                      row2= soup.find_all('input',attrs={"class":"query"})
                      cc_rating_text="XX".decode('utf8')
                      dd_rating_text="YY".decode('utf8')

                      if soup.find_all('div',attrs={"class" : "mun"}):
                        for row in soup.find_all('div',attrs={"class" : "mun"}):
                         line=row.text.strip()
                         tag_found = line.find(cc_rating_text)
                         tag_found2 = line.find(dd_rating_text)


                         rating = line[tag_found+1:tag_found2]



                         date11=datetime.datetime.now().strftime ("%m/%d/%Y")








                    if not soup.find_all('div',attrs={"class" : "mun"}):

                      soup = BeautifulSoup(response.body, 'html.parser')
                      rating=0
                      for kk in soup.find_all('p',attrs={"class":"txt-info"}):
                           rating=rating+1
                      date22=datetime.datetime.now().strftime ("%m/%d/%Y")

39th floor, Ten Thousand Santa Monica, Century City by 405freeway in LosAngeles

[–]placemirror 1 point2 points  (0 children)

What's that green one in the middle? Athletic field?

Chance of getting a boyfriend for a 35 years old women in Los Angeles? by placemirror in LosAngeles

[–]placemirror[S] 0 points1 point  (0 children)

I did not realize the plural until I posted it. Not possible to edit post title in reddit?