@@ -599,19 +599,30 @@ class IndexingError(Exception):
599
599
"""
600
600
Exception is raised when trying to index and there is a mismatch in dimensions.
601
601
602
+ Raised by properties like :attr:`.pandas.DataFrame.iloc` when
603
+ an indexer is out of bounds or :attr:`.pandas.DataFrame.loc` when its index is
604
+ unalignable to the frame index.
605
+
606
+ See Also
607
+ --------
608
+ DataFrame.iloc : Purely integer-location based indexing for \
609
+ selection by position.
610
+ DataFrame.loc : Access a group of rows and columns by label(s) \
611
+ or a boolean array.
612
+
602
613
Examples
603
614
--------
604
615
>>> df = pd.DataFrame({'A': [1, 1, 1]})
605
- >>> df.loc[..., ..., 'A'] # doctest: +SKIP
616
+ >>> df.loc[..., ..., 'A'] # doctest: +SKIP
606
617
... # IndexingError: indexer may only contain one '...' entry
607
618
>>> df = pd.DataFrame({'A': [1, 1, 1]})
608
- >>> df.loc[1, ..., ...] # doctest: +SKIP
619
+ >>> df.loc[1, ..., ...] # doctest: +SKIP
609
620
... # IndexingError: Too many indexers
610
- >>> df[pd.Series([True], dtype=bool)] # doctest: +SKIP
621
+ >>> df[pd.Series([True], dtype=bool)] # doctest: +SKIP
611
622
... # IndexingError: Unalignable boolean Series provided as indexer...
612
623
>>> s = pd.Series(range(2),
613
- ... index = pd.MultiIndex.from_product([["a", "b"], ["c"]]))
614
- >>> s.loc["a", "c", "d"] # doctest: +SKIP
624
+ ... index= pd.MultiIndex.from_product([["a", "b"], ["c"]]))
625
+ >>> s.loc["a", "c", "d"] # doctest: +SKIP
615
626
... # IndexingError: Too many indexers
616
627
"""
617
628
@@ -713,13 +724,19 @@ class AttributeConflictWarning(Warning):
713
724
714
725
class DatabaseError (OSError ):
715
726
"""
716
- Error is raised when executing sql with bad syntax or sql that throws an error.
727
+ Error is raised when executing SQL with bad syntax or SQL that throws an error.
728
+
729
+ Raised by :func:`.pandas.read_sql` when a bad SQL statement is passed in.
730
+
731
+ See Also
732
+ --------
733
+ read_sql : Read SQL query or database table into a DataFrame.
717
734
718
735
Examples
719
736
--------
720
737
>>> from sqlite3 import connect
721
738
>>> conn = connect(':memory:')
722
- >>> pd.read_sql('select * test', conn) # doctest: +SKIP
739
+ >>> pd.read_sql('select * test', conn) # doctest: +SKIP
723
740
... # DatabaseError: Execution failed on sql 'test': near "test": syntax error
724
741
"""
725
742
@@ -758,10 +775,14 @@ class InvalidColumnName(Warning):
758
775
Because the column name is an invalid Stata variable, the name needs to be
759
776
converted.
760
777
778
+ See Also
779
+ --------
780
+ DataFrame.to_stata : Export DataFrame object to Stata dta format.
781
+
761
782
Examples
762
783
--------
763
784
>>> df = pd.DataFrame({"0categories": pd.Series([2, 2])})
764
- >>> df.to_stata('test') # doctest: +SKIP
785
+ >>> df.to_stata('test') # doctest: +SKIP
765
786
... # InvalidColumnName: Not all pandas column names were valid Stata variable...
766
787
"""
767
788
0 commit comments