@@ -58,9 +58,7 @@ def __call__(self, args, kwargs, fname=None, max_fname_arg_count=None, method=No
58
58
fname , args , kwargs , max_fname_arg_count , self .defaults
59
59
)
60
60
else :
61
- raise ValueError (
62
- "invalid validation method '{method}'" .format (method = method )
63
- )
61
+ raise ValueError (f"invalid validation method '{ method } '" )
64
62
65
63
66
64
ARGMINMAX_DEFAULTS = dict (out = None )
@@ -312,9 +310,8 @@ def validate_take_with_convert(convert, args, kwargs):
312
310
def validate_window_func (name , args , kwargs ):
313
311
numpy_args = ("axis" , "dtype" , "out" )
314
312
msg = (
315
- "numpy operations are not "
316
- "valid with window objects. "
317
- "Use .{func}() directly instead " .format (func = name )
313
+ f"numpy operations are not valid with window objects. "
314
+ f"Use .{ name } () directly instead "
318
315
)
319
316
320
317
if len (args ) > 0 :
@@ -328,9 +325,8 @@ def validate_window_func(name, args, kwargs):
328
325
def validate_rolling_func (name , args , kwargs ):
329
326
numpy_args = ("axis" , "dtype" , "out" )
330
327
msg = (
331
- "numpy operations are not "
332
- "valid with window objects. "
333
- "Use .rolling(...).{func}() instead " .format (func = name )
328
+ f"numpy operations are not valid with window objects. "
329
+ f"Use .rolling(...).{ name } () instead "
334
330
)
335
331
336
332
if len (args ) > 0 :
@@ -344,9 +340,8 @@ def validate_rolling_func(name, args, kwargs):
344
340
def validate_expanding_func (name , args , kwargs ):
345
341
numpy_args = ("axis" , "dtype" , "out" )
346
342
msg = (
347
- "numpy operations are not "
348
- "valid with window objects. "
349
- "Use .expanding(...).{func}() instead " .format (func = name )
343
+ f"numpy operations are not valid with window objects. "
344
+ f"Use .expanding(...).{ name } () instead "
350
345
)
351
346
352
347
if len (args ) > 0 :
@@ -371,11 +366,9 @@ def validate_groupby_func(name, args, kwargs, allowed=None):
371
366
372
367
if len (args ) + len (kwargs ) > 0 :
373
368
raise UnsupportedFunctionCall (
374
- (
375
- "numpy operations are not valid "
376
- "with groupby. Use .groupby(...)."
377
- "{func}() instead" .format (func = name )
378
- )
369
+ f"numpy operations are not valid with "
370
+ f"groupby. Use .groupby(...).{ name } () "
371
+ f"instead"
379
372
)
380
373
381
374
@@ -391,11 +384,9 @@ def validate_resampler_func(method, args, kwargs):
391
384
if len (args ) + len (kwargs ) > 0 :
392
385
if method in RESAMPLER_NUMPY_OPS :
393
386
raise UnsupportedFunctionCall (
394
- (
395
- "numpy operations are not valid "
396
- "with resample. Use .resample(...)."
397
- "{func}() instead" .format (func = method )
398
- )
387
+ f"numpy operations are not "
388
+ f"valid with resample. Use "
389
+ f".resample(...).{ method } () instead"
399
390
)
400
391
else :
401
392
raise TypeError ("too many arguments passed in" )
@@ -418,7 +409,4 @@ def validate_minmax_axis(axis):
418
409
if axis is None :
419
410
return
420
411
if axis >= ndim or (axis < 0 and ndim + axis < 0 ):
421
- raise ValueError (
422
- "`axis` must be fewer than the number of "
423
- "dimensions ({ndim})" .format (ndim = ndim )
424
- )
412
+ raise ValueError (f"`axis` must be fewer than the number of dimensions ({ ndim } )" )
0 commit comments