NumPy
keyboard_arrow_down 319 guides
chevron_leftChar
Method addMethod capitalizeMethod centerMethod countMethod endswithMethod equalMethod expandtabsMethod findMethod greaterMethod greater_equalMethod indexMethod isalnumMethod isalphaMethod isdecimalMethod isdigitMethod isnumericMethod isupperMethod joinMethod lessMethod less_equalMethod ljustMethod lowerMethod multiplyMethod not_equalMethod rfindMethod rjustMethod rstripMethod splitMethod splitlinesMethod startswithMethod upperMethod zfill
check_circle
Mark as learned thumb_up
0
thumb_down
0
chat_bubble_outline
0
Comment auto_stories Bi-column layout
settings
NumPy | expandtabs method
schedule Aug 12, 2023
Last updated local_offer
Tags Python●NumPy
tocTable of Contents
expand_more Master the mathematics behind data science with 100+ top-tier guides
Start your free 7-days trial now!
Start your free 7-days trial now!
Numpy's expandtabs(~)
method replaces all instances of "\t"
with the specified number of spaces.
Parameters
1. tabsize
| int
The desired number of whitespaces to replace the "\t"
s by. By default, tabsize=8
.
Return value
A copy of each string element with tabs replaced with the specified number of spaces.
Examples
np.char.expandtabs("\t")
array(' ', dtype='<U8')
Here, we have 8 whitespaces.
np.char.expandtabs("\t", tabsize=2)
array(' ', dtype='<U2')
Here, we have 2 whitespaces.
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
thumb_up
thumb_down
Comment
Citation
Ask a question or leave a feedback...
Official NumPy Documentation
https://numpy.org/doc/stable/reference/generated/numpy.char.expandtabs.html
thumb_up
0
thumb_down
0
chat_bubble_outline
0
settings
Enjoy our search
Hit / to insta-search docs and recipes!