Coder Social home page Coder Social logo

advanture_of_code's People

Contributors

codeofcloud avatar ryanguorl avatar samxzeng avatar taos0002 avatar taosuijl avatar tyler1zhang avatar

Watchers

 avatar

Forkers

taosuijl

advanture_of_code's Issues

Functional

If you want to use function, better can put the 00000 as one argument, then easier to reuse
image

map cannot be called twice, why?

losing map, map cannto be used 2nd time, why?

a = range(1,10)
mymap = map(lambda x: x*x, a)
list1 = list(mymap)
list2 = list(mymap)

print(f'my list1 is {list1}')
print(f'my list2 is {list2}')

question for q2

  1. 你为什么更喜欢在一开始用tuple来存储数据?
  2. boxspecint=list(map(int, boxspec))这句的map是个没见过的函数。
  3. calnum=reduce((lambda x,y:x+y), results) 为什么用这种方式求和,看不懂reduce的好处

why the final df is empty

import pandas as pd

lst1 = ['(22,99)@(214395,133691)@Angle_Angle.jpg',
 '(100,103)@(126184,138057)@PadDefect2_PadDefect2600.jpg',
 '(100,156)@(126221,192559)@PadDefect2_PadDefect2600.jpg']

df = pd.DataFrame(columns = ['X', 'Y', 'DC'])

for f in lst1:
    [a, b] = f.split('@')[0::2]
    x, y = a.replace(r'(', '').replace(r')', '').split(',')
    #print([int(x), int(y), b.split('.')[0]])
    temp_pd = pd.DataFrame([[int(x), int(y), b.split('.')[0]]], columns = ['X', 'Y', 'DC'])
    print(temp_pd)
    df.append(temp_pd)
    
df

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.