zach14c icon

Untitled

zach14c | PRO | 11/27/18 11:28:35 PM UTC | 0 ⭐ | 273 👁️ | Never ⏰ | []
Python |

360 B

|

None

|

0 👍

/

0 👎

# 使用項目符號進行切分
def parse_info(row): 
          if not 'sqft' in row: 
               br, ba = row.split('')[:2] 
               sqft = np.nan 
          else: 
               br, ba, sqft = row.split('.')[:3] 
          return pd.Series({'Beds': br, 'Baths': ba, 'Sqft': sqft}) 
 
attr = sucln['propertyinfo_value'].apply(parse_info) 
 
attr

Comments